aboutsummaryrefslogtreecommitdiff
path: root/src/sp/transport/tls
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-04-27 12:00:34 -0700
committerGarrett D'Amore <garrett@damore.org>2024-05-30 07:28:48 -0700
commit11dbeed1a8d81c775a64e22707f5fcadb240829e (patch)
tree0983d4fda5ce289e4a473269487ca963a397b887 /src/sp/transport/tls
parent3a94e22db2e9f548ff81369dd2ac2badb5b6ac0f (diff)
downloadnng-11dbeed1a8d81c775a64e22707f5fcadb240829e.tar.gz
nng-11dbeed1a8d81c775a64e22707f5fcadb240829e.tar.bz2
nng-11dbeed1a8d81c775a64e22707f5fcadb240829e.zip
Another attempt at the close deadlock, fix use-after-free.
When closing pipes, we defer them to be reaped, but also leave them in the match list where they might be picked up by ep_match, or leak. It's best to reap these proactively and ensure that they are not allowed to life longer once they have errored during the negotiation phase.
Diffstat (limited to 'src/sp/transport/tls')
-rw-r--r--src/sp/transport/tls/tls.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sp/transport/tls/tls.c b/src/sp/transport/tls/tls.c
index 30a95725..631d74d7 100644
--- a/src/sp/transport/tls/tls.c
+++ b/src/sp/transport/tls/tls.c
@@ -285,6 +285,7 @@ error:
if (rv == NNG_ECLOSED) {
rv = NNG_ECONNSHUT;
}
+ nni_list_remove(&ep->negopipes, p);
nng_stream_close(p->tls);
if ((uaio = ep->useraio) != NULL) {