summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2010-01-08 15:44:51 +0100
committerMartin Sustrik <sustrik@fastmq.commkdir>2010-01-08 15:44:51 +0100
commite806615dd18e625b0b7fb1074cc4da5fda18529b (patch)
treefa17e1780d89f69d5f096f901f9c24263b3f00d2 /src
parent9fc8827b8a8e9d842b85b7f7f9790fc0a2ef88f6 (diff)
ZMQII-31: memory leak in zmq_poll (on timeout)
Diffstat (limited to 'src')
-rw-r--r--src/zmq.cpp4
1 files changed, 3 insertions, 1 deletions
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;