Problem: sub.xsetsockopt leaks message (0..n bytes) payload on fail.

This commit is contained in:
evoskuil 2017-03-30 14:06:39 -07:00
parent 1b79da0d7d
commit 6436bc51e6

View File

@ -69,15 +69,8 @@ int zmq::sub_t::xsetsockopt (int option_, const void *optval_,
memcpy (data + 1, optval_, optvallen_);
}
// Pass it further on in the stack.
int err = 0;
rc = xsub_t::xsend (&msg);
if (rc != 0)
err = errno;
int rc2 = msg.close ();
errno_assert (rc2 == 0);
if (rc != 0)
errno = err;
return rc;
return close_and_return (&msg, rc);
}
int zmq::sub_t::xsend (msg_t *)