From ab7772be3e3c208a48408b67924d3b58fca7f474 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 18 Jul 2017 11:00:08 -0700 Subject: Fix close-related leak of pipes. We have seen leaks of pipes causing test failures (e.g. the Windows IPC test) due to EADDRINUSE. This was caused by a case where we failed to pass the pipe up because the AIO had already been canceled, and we didn't realize that we had oprhaned the pipe. The fix is to add a return value to nni_aio_finish, and verify that we did finish properly, or if we did not then we must free the pipe ourself. (The zero return from nni_aio_finish indicates that it accepts ownership of resources passed via the aio.) --- src/core/socket.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/core/socket.c') diff --git a/src/core/socket.c b/src/core/socket.c index 7ec383d4..10bc1c80 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -124,8 +124,7 @@ nni_sock_pipe_ready(nni_sock *sock, nni_pipe *pipe) void nni_sock_pipe_remove(nni_sock *sock, nni_pipe *pipe) { - void * pdata; - nni_ep *ep; + void *pdata; pdata = nni_pipe_get_proto_data(pipe); -- cgit v1.2.3-70-g09d2