aboutsummaryrefslogtreecommitdiff
path: root/src/sp/transport/ipc
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2023-11-26 09:53:40 -0800
committerGarrett D'Amore <garrett@damore.org>2023-11-26 09:53:40 -0800
commit759a2e9d65bd093ac9740d2cf0aa38a0212c5c23 (patch)
treeeab1df58753bc40e89cfdcf25a9963a928ddd2ec /src/sp/transport/ipc
parent003f0556a61f3e7225f4f0d0087bdf08af5b632a (diff)
downloadnng-759a2e9d65bd093ac9740d2cf0aa38a0212c5c23.tar.gz
nng-759a2e9d65bd093ac9740d2cf0aa38a0212c5c23.tar.bz2
nng-759a2e9d65bd093ac9740d2cf0aa38a0212c5c23.zip
fixes #1713 SP pipe_send leaks message if aio is canceled
Diffstat (limited to 'src/sp/transport/ipc')
-rw-r--r--src/sp/transport/ipc/ipc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sp/transport/ipc/ipc.c b/src/sp/transport/ipc/ipc.c
index df27ad23..a8fc954b 100644
--- a/src/sp/transport/ipc/ipc.c
+++ b/src/sp/transport/ipc/ipc.c
@@ -518,6 +518,10 @@ ipc_pipe_send(void *arg, nni_aio *aio)
int rv;
if (nni_aio_begin(aio) != 0) {
+ // No way to give the message back to the protocol, so
+ // we just discard it silently to prevent it from leaking.
+ nni_msg_free(nni_aio_get_msg(aio));
+ nni_aio_set_msg(aio, NULL);
return;
}
nni_mtx_lock(&p->mtx);