diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-07-18 11:00:08 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-07-18 11:00:08 -0700 |
| commit | ab7772be3e3c208a48408b67924d3b58fca7f474 (patch) | |
| tree | b7355183556350de73303c6e75a5d278528dda0e /src/core/socket.c | |
| parent | c41129ca0efacf13fe1363ed12f9723274c521e7 (diff) | |
| download | nng-ab7772be3e3c208a48408b67924d3b58fca7f474.tar.gz nng-ab7772be3e3c208a48408b67924d3b58fca7f474.tar.bz2 nng-ab7772be3e3c208a48408b67924d3b58fca7f474.zip | |
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.)
Diffstat (limited to 'src/core/socket.c')
| -rw-r--r-- | src/core/socket.c | 3 |
1 files changed, 1 insertions, 2 deletions
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); |
