diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-05-27 19:21:17 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-05-30 07:28:48 -0700 |
| commit | 6a2a8aa7806953d221f8818982a30cdcea47a82b (patch) | |
| tree | 00010e6d8abf873acac402416596fe862a07cb35 /src/sp/transport/tls | |
| parent | 76707668e3593094e1c5e675691b11230a565a1e (diff) | |
| download | nng-6a2a8aa7806953d221f8818982a30cdcea47a82b.tar.gz nng-6a2a8aa7806953d221f8818982a30cdcea47a82b.tar.bz2 nng-6a2a8aa7806953d221f8818982a30cdcea47a82b.zip | |
Free SP protocol streams before discarding aio objects.
This seems to alleviate the use after free crashes, although it
does not seem like it should. Current theory is that this closes
the handle ensuring that it is unregistered from the I/O subsystem,
thus preventing callbacks from firing and referring to objects that
have been freed.
Diffstat (limited to 'src/sp/transport/tls')
| -rw-r--r-- | src/sp/transport/tls/tls.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sp/transport/tls/tls.c b/src/sp/transport/tls/tls.c index 631d74d7..240b1ed9 100644 --- a/src/sp/transport/tls/tls.c +++ b/src/sp/transport/tls/tls.c @@ -153,10 +153,10 @@ tlstran_pipe_fini(void *arg) } nni_mtx_unlock(&ep->mtx); } + nng_stream_free(p->tls); nni_aio_free(p->rxaio); nni_aio_free(p->txaio); nni_aio_free(p->negoaio); - nng_stream_free(p->tls); nni_msg_free(p->rxmsg); NNI_FREE_STRUCT(p); } |
