aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/protocol/reqrep/req.c3
-rw-r--r--tests/reqrep.c1
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);
})
})
})