Skip to content

Commit

Permalink
Merge pull request #1900 from hitstergtd/hitstergtd-testudp-fix
Browse files Browse the repository at this point in the history
Problem: test_udp does not release resources properly
  • Loading branch information
bluca committed Apr 18, 2016
2 parents c354e0b + 9a9bfb6 commit 1d083a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ int msg_recv_cmp (zmq_msg_t *msg_, void *s_, const char* group_, const char* bod
return -1;

int recv_rc = zmq_msg_recv (msg_, s_, 0);
if (recv_rc == -1)
if (recv_rc == -1) {
zmq_msg_close(msg_);
return -1;
}

if (strcmp (zmq_msg_group (msg_), group_) != 0)
{
Expand All @@ -73,6 +75,7 @@ int msg_recv_cmp (zmq_msg_t *msg_, void *s_, const char* group_, const char* bod
if (strcmp (body, body_) != 0)
{
zmq_msg_close (msg_);
free(body);
return -1;
}

Expand Down

0 comments on commit 1d083a3

Please sign in to comment.