Commit 9d02b3da authored by Pieter Hintjens's avatar Pieter Hintjens

Merge pull request #323 from hurtonm/xsub_fix_message_initialisation

xsub: fix memory leak
parents 016df8e8 df5344bb
......@@ -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 ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment