From d7df4563aea6ba519cf4aa825e49f373e012cc7f Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 8 Dec 2024 21:09:45 -0800 Subject: [PATCH] pipe: hold on to the socket / dialer until the pipe is freed This avoids a problem where the teardown of the socket proceeds and orphans the pipe, which can manifest as a leak at shutdown. --- src/core/pipe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/pipe.c b/src/core/pipe.c index eaf49af9c..a2fcb823e 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -40,6 +40,8 @@ pipe_destroy(void *arg) p->p_proto_ops.pipe_fini(p->p_proto_data); p->p_tran_ops.p_fini(p->p_tran_data); + nni_pipe_remove(p); + nni_free(p, p->p_size); } @@ -70,8 +72,6 @@ pipe_reap(void *arg) p->p_proto_ops.pipe_stop(p->p_proto_data); p->p_tran_ops.p_stop(p->p_tran_data); - nni_pipe_remove(p); - nni_pipe_rele(p); }