From 2c3913bb19fa95e7decaa7967e2469dc428e46b0 Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Sat, 19 Jun 2010 19:46:35 +0200 Subject: fix double free error in PAIR socket --- src/pair.cpp | 3 +++ 1 file changed, 3 insertions(+) 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; } -- cgit v1.2.3