diff options
| author | Garrett D'Amore <garrett@damore.org> | 2023-11-26 09:53:40 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2023-11-26 09:53:40 -0800 |
| commit | 759a2e9d65bd093ac9740d2cf0aa38a0212c5c23 (patch) | |
| tree | eab1df58753bc40e89cfdcf25a9963a928ddd2ec /src/sp/transport/zerotier | |
| parent | 003f0556a61f3e7225f4f0d0087bdf08af5b632a (diff) | |
| download | nng-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/zerotier')
| -rw-r--r-- | src/sp/transport/zerotier/zerotier.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sp/transport/zerotier/zerotier.c b/src/sp/transport/zerotier/zerotier.c index 5658fb18..f3de3504 100644 --- a/src/sp/transport/zerotier/zerotier.c +++ b/src/sp/transport/zerotier/zerotier.c @@ -1,6 +1,6 @@ // +// Copyright 2023 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2021 Capitar IT Group BV <info@capitar.com> -// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -1821,6 +1821,10 @@ zt_pipe_send(void *arg, nni_aio *aio) nni_msg *m; 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; } if ((m = nni_aio_get_msg(aio)) == NULL) { |
