aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-19 14:10:04 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-19 14:10:04 -0800
commita26375dc1ec12c41aaedf3e374175d37a1ae84e9 (patch)
tree8de2ac2674f9d1639c4fad0e0cb2ac3714a22a75
parent70c6f49a552b97b455d9f9c4419129463a30847d (diff)
downloadnng-a26375dc1ec12c41aaedf3e374175d37a1ae84e9.tar.gz
nng-a26375dc1ec12c41aaedf3e374175d37a1ae84e9.tar.bz2
nng-a26375dc1ec12c41aaedf3e374175d37a1ae84e9.zip
Fix leak in surveyor pipe.
-rw-r--r--src/protocol/survey/survey.c7
-rw-r--r--tests/reqrep.c1
2 files changed, 5 insertions, 3 deletions
diff --git a/src/protocol/survey/survey.c b/src/protocol/survey/survey.c
index c7ce1c16..087211a2 100644
--- a/src/protocol/survey/survey.c
+++ b/src/protocol/survey/survey.c
@@ -114,10 +114,11 @@ nni_surv_pipe_init(void **pp, nni_pipe *npipe, void *psock)
static void
nni_surv_pipe_fini(void *arg)
{
- nni_surv_pipe *sp = arg;
+ nni_surv_pipe *ppipe = arg;
- if (sp != NULL) {
- NNI_FREE_STRUCT(sp);
+ if (ppipe != NULL) {
+ nni_msgq_fini(ppipe->sendq);
+ NNI_FREE_STRUCT(ppipe);
}
}
diff --git a/tests/reqrep.c b/tests/reqrep.c
index 1a9f3735..9fd2a206 100644
--- a/tests/reqrep.c
+++ b/tests/reqrep.c
@@ -9,6 +9,7 @@
#include "convey.h"
#include "nng.h"
+#include "core/nng_impl.h"
#include <string.h>