Skip to content

Commit

Permalink
pipe: hold on to the socket / dialer until the pipe is freed
Browse files Browse the repository at this point in the history
This avoids a problem where the teardown of the socket proceeds
and orphans the pipe, which can manifest as a leak at shutdown.
  • Loading branch information
gdamore committed Dec 9, 2024
1 parent f292cc6 commit d7df456
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit d7df456

Please sign in to comment.