summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Hurton <hurtonm@gmail.com>2010-06-19 19:46:35 +0200
committerMartin Hurton <hurtonm@gmail.com>2010-06-19 19:50:55 +0200
commit2c3913bb19fa95e7decaa7967e2469dc428e46b0 (patch)
treebe8229abf7c06768575aef6a4a1e2084b5c0fe16
parentcff7ba2315c0f62fa3679afa24ecea88da38a365 (diff)
fix double free error in PAIR socket
-rw-r--r--src/pair.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pair.cpp b/src/pair.cpp
index 31524de..3872b28 100644
--- a/src/pair.cpp
+++ b/src/pair.cpp
@@ -115,6 +115,9 @@ int zmq::pair_t::xrecv (zmq_msg_t *msg_, int flags_)
zmq_msg_close (msg_);
if (!alive || !inpipe || !inpipe->read (msg_)) {
+ // No message is available. Initialise the output parameter
+ // to be a 0-byte message.
+ zmq_msg_init (msg_);
errno = EAGAIN;
return -1;
}