summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/frr_zmq.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/frr_zmq.c b/lib/frr_zmq.c
index ea9c828f7c..994fe656fd 100644
--- a/lib/frr_zmq.c
+++ b/lib/frr_zmq.c
@@ -92,7 +92,8 @@ static int frrzmq_read_msg(struct thread *t)
ZMQ_POLLOUT);
cb->read.thread = NULL;
if (cb->write.cancelled && !cb->write.thread)
- XFREE(MTYPE_ZEROMQ_CB, cb);
+ XFREE(MTYPE_ZEROMQ_CB, *cbp);
+
return 0;
}
continue;
@@ -120,7 +121,8 @@ static int frrzmq_read_msg(struct thread *t)
ZMQ_POLLOUT);
cb->read.thread = NULL;
if (cb->write.cancelled && !cb->write.thread)
- XFREE(MTYPE_ZEROMQ_CB, cb);
+ XFREE(MTYPE_ZEROMQ_CB, *cbp);
+
return 0;
}
@@ -239,7 +241,8 @@ static int frrzmq_write_msg(struct thread *t)
frrzmq_check_events(cbp, &cb->read, ZMQ_POLLIN);
cb->write.thread = NULL;
if (cb->read.cancelled && !cb->read.thread)
- XFREE(MTYPE_ZEROMQ_CB, cb);
+ XFREE(MTYPE_ZEROMQ_CB, *cbp);
+
return 0;
}
continue;