diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-08-11 17:51:41 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-08-11 17:51:41 -0700 |
| commit | ee4572147ade37bf07f8ef2f3049e8c81df312b7 (patch) | |
| tree | 8a50a209aed7048671c567cae2780c779d95770d /src/protocol | |
| parent | 2a11fd60767335660dc506237a9302dcbc5da91e (diff) | |
| download | nng-ee4572147ade37bf07f8ef2f3049e8c81df312b7.tar.gz nng-ee4572147ade37bf07f8ef2f3049e8c81df312b7.tar.bz2 nng-ee4572147ade37bf07f8ef2f3049e8c81df312b7.zip | |
Fix leaks found in pairv1 test suite.
Diffstat (limited to 'src/protocol')
| -rw-r--r-- | src/protocol/pair/pair_v1.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/protocol/pair/pair_v1.c b/src/protocol/pair/pair_v1.c index 183c260a..1a7ad9fa 100644 --- a/src/protocol/pair/pair_v1.c +++ b/src/protocol/pair/pair_v1.c @@ -177,16 +177,16 @@ pair1_pipe_stop(void *arg) pair1_pipe *p = arg; pair1_sock *s = p->psock; + nni_mtx_lock(&s->mtx); + nni_idhash_remove(s->pipes, nni_pipe_id(p->npipe)); + nni_list_node_remove(&p->node); + nni_mtx_unlock(&s->mtx); + nni_msgq_close(p->sendq); nni_aio_cancel(&p->aio_send, NNG_ECANCELED); nni_aio_cancel(&p->aio_recv, NNG_ECANCELED); nni_aio_cancel(&p->aio_putq, NNG_ECANCELED); nni_aio_cancel(&p->aio_getq, NNG_ECANCELED); - - nni_mtx_lock(&s->mtx); - nni_idhash_remove(s->pipes, nni_pipe_id(p->npipe)); - nni_list_node_remove(&p->node); - nni_mtx_unlock(&s->mtx); } static void |
