From 759a2e9d65bd093ac9740d2cf0aa38a0212c5c23 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 26 Nov 2023 09:53:40 -0800 Subject: fixes #1713 SP pipe_send leaks message if aio is canceled --- src/sp/transport/inproc/inproc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/sp/transport/inproc/inproc.c') diff --git a/src/sp/transport/inproc/inproc.c b/src/sp/transport/inproc/inproc.c index 2ab8b0b9..978b6679 100644 --- a/src/sp/transport/inproc/inproc.c +++ b/src/sp/transport/inproc/inproc.c @@ -1,5 +1,5 @@ // -// Copyright 2020 Staysail Systems, Inc. +// Copyright 2023 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // Copyright 2018 Devolutions // @@ -207,6 +207,10 @@ inproc_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; } -- cgit v1.2.3-70-g09d2