Skip to content

Commit

Permalink
zmq_msg_move called on uninitialised message in xrep_t::xrecv -- fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Wolf authored and sustrik committed Sep 30, 2010
1 parent c1deb22 commit 79aea5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -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>
Expand Down
7 changes: 4 additions & 3 deletions src/xrep.cpp
Expand Up @@ -190,16 +190,17 @@ 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;
prefetched = false;
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);
Expand Down

0 comments on commit 79aea5f

Please sign in to comment.