From 4121745aad5b3a1c483c6bffb22dcae6e132d4f9 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 7 Jan 2017 22:05:07 -0800 Subject: Race condition fix attempt. --- src/core/endpt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/endpt.c') diff --git a/src/core/endpt.c b/src/core/endpt.c index 5f695d41..554d9a36 100644 --- a/src/core/endpt.c +++ b/src/core/endpt.c @@ -107,7 +107,7 @@ nni_ep_connect(nni_ep *ep, nni_pipe **pp) } rv = ep->ep_ops.ep_connect(ep->ep_data, &pipe->p_tran_data); if (rv != 0) { - nni_pipe_close(pipe); + nni_pipe_destroy(pipe); return (rv); } ep->ep_pipe = pipe; @@ -243,7 +243,7 @@ nni_ep_accept(nni_ep *ep, nni_pipe **pp) } rv = ep->ep_ops.ep_accept(ep->ep_data, &pipe->p_tran_data); if (rv != 0) { - nni_pipe_close(pipe); + nni_pipe_destroy(pipe); return (rv); } *pp = pipe; -- cgit v1.2.3-70-g09d2