mirror of
https://github.com/zeromq/libzmq.git
synced 2025-02-25 07:41:10 +01:00
Merge pull request #323 from hurtonm/xsub_fix_message_initialisation
xsub: fix memory leak
This commit is contained in:
commit
9d02b3dafb
14
src/xsub.cpp
14
src/xsub.cpp
@ -94,18 +94,18 @@ int zmq::xsub_t::xsend (msg_t *msg_, int flags_)
|
||||
if (*data == 1) {
|
||||
if (subscriptions.add (data + 1, size - 1))
|
||||
return dist.send_to_all (msg_, flags_);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else if (*data == 0) {
|
||||
else {
|
||||
if (subscriptions.rm (data + 1, size - 1))
|
||||
return dist.send_to_all (msg_, flags_);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
zmq_assert (false);
|
||||
return -1;
|
||||
int rc = msg_->close ();
|
||||
errno_assert (rc == 0);
|
||||
rc = msg_->init ();
|
||||
errno_assert (rc == 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool zmq::xsub_t::xhas_out ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user