diff options
author | Max Wolf <YIDIEPXGXGPN@spammotel.com> | 2010-09-30 15:10:47 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-09-30 15:10:47 +0200 |
commit | 79aea5ffa61f969ec66205f7c9c8c1611a2fd8da (patch) | |
tree | c56e0c0e9f5ade22560b7936a419bdec88eeb648 | |
parent | c1deb226f4d1bc94c158c050088813aae96775e9 (diff) |
zmq_msg_move called on uninitialised message in xrep_t::xrecv -- fixed
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | src/xrep.cpp | 7 |
2 files changed, 5 insertions, 3 deletions
@@ -24,6 +24,7 @@ Martin Hurton <hurtonm@gmail.com> Martin Lucina <mato@kotelna.sk> Martin Sustrik <sustrik@250bpm.com> Matus Hamorsky <mhamorsky@gmail.com> +Max Wolf <YIDIEPXGXGPN@spammotel.com> McClain Looney <m@loonsoft.com> Mikael Helbo Kjaer <mhk@designtech.dk> Pavel Gushcha <pavimus@gmail.com> diff --git a/src/xrep.cpp b/src/xrep.cpp index 5fd6cbb..f50e32e 100644 --- a/src/xrep.cpp +++ b/src/xrep.cpp @@ -190,9 +190,7 @@ int zmq::xrep_t::xsend (zmq_msg_t *msg_, int flags_) int zmq::xrep_t::xrecv (zmq_msg_t *msg_, int flags_) { - // Deallocate old content of the message. - zmq_msg_close (msg_); - + // If there is a prefetched message, return it. if (prefetched) { zmq_msg_move (msg_, &prefetched_msg); more_in = msg_->flags & ZMQ_MSG_MORE; @@ -200,6 +198,9 @@ int zmq::xrep_t::xrecv (zmq_msg_t *msg_, int flags_) return 0; } + // Deallocate old content of the message. + zmq_msg_close (msg_); + // If we are in the middle of reading a message, just grab next part of it. if (more_in) { zmq_assert (inpipes [current_in].active); |