Commit 82dbef36 authored by Martin Sustrik's avatar Martin Sustrik

Memory leak in zmq_recv fixed

Signed-off-by: 's avatarMartin Sustrik <sustrik@250bpm.com>
parent abb184a0
......@@ -384,6 +384,10 @@ int zmq_recv (void *s_, void *buf_, size_t len_, int flags_)
// TODO: Build in a notification mechanism to report the overflows.
size_t to_copy = size_t (rc) < len_ ? size_t (rc) : len_;
memcpy (buf_, zmq_msg_data (&msg), to_copy);
rc = zmq_msg_close (&msg);
errno_assert (rc == 0);
return (int) to_copy;
}
......
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