From e806615dd18e625b0b7fb1074cc4da5fda18529b Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Fri, 8 Jan 2010 15:44:51 +0100 Subject: ZMQII-31: memory leak in zmq_poll (on timeout) --- AUTHORS | 1 + src/zmq.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 2f653a7..16bddde 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,6 +10,7 @@ Erich Heine Frank Denis George Neill Jon Dyte +Kamil Shakirov Martin Hurton Martin Lucina Martin Sustrik diff --git a/src/zmq.cpp b/src/zmq.cpp index 62ee562..689a1e7 100644 --- a/src/zmq.cpp +++ b/src/zmq.cpp @@ -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; -- cgit v1.2.3