diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-02 17:48:14 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-02 17:48:14 -0800 |
| commit | 29678ad27eff07ef0c4726b01a07794f5bff1bc7 (patch) | |
| tree | 295ce05c7944c1ee02871e0de29582a59bdbc498 | |
| parent | 13e380343c0eec96a723e7407d59fb7f5d20aba0 (diff) | |
| download | nng-29678ad27eff07ef0c4726b01a07794f5bff1bc7.tar.gz nng-29678ad27eff07ef0c4726b01a07794f5bff1bc7.tar.bz2 nng-29678ad27eff07ef0c4726b01a07794f5bff1bc7.zip | |
Leak fixes for valgrind.
| -rw-r--r-- | src/protocol/reqrep/req.c | 3 | ||||
| -rw-r--r-- | tests/reqrep.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/protocol/reqrep/req.c b/src/protocol/reqrep/req.c index 9cfc6f54..0879755f 100644 --- a/src/protocol/reqrep/req.c +++ b/src/protocol/reqrep/req.c @@ -103,6 +103,9 @@ nni_req_fini(void *arg) nni_thr_fini(&req->resender); nni_cv_fini(&req->cv); nni_mtx_fini(&req->mx); + if (req->reqmsg != NULL) { + nni_msg_free(req->reqmsg); + } NNI_FREE_STRUCT(req); } diff --git a/tests/reqrep.c b/tests/reqrep.c index 4322edda..fb9a7fb4 100644 --- a/tests/reqrep.c +++ b/tests/reqrep.c @@ -115,6 +115,7 @@ Main({ body = nng_msg_body(ping, &len); So(len == 5); So(memcmp(body, "pong", 5) == 0); + nng_msg_free(ping); }) }) }) |
