Commit e806615d authored by Martin Sustrik's avatar Martin Sustrik

ZMQII-31: memory leak in zmq_poll (on timeout)

parent 9fc8827b
......@@ -10,6 +10,7 @@ Erich Heine
Frank Denis
George Neill
Jon Dyte
Kamil Shakirov
Martin Hurton
Martin Lucina
Martin Sustrik
......
......@@ -338,8 +338,10 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
errno_assert (rc >= 0);
// If timeout was hit with no events signaled, return zero.
if (!initial && rc == 0)
if (!initial && rc == 0) {
free (pollfds);
return 0;
}
// From now on, perform blocking polling.
initial = false;
......
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