]> git.meshlink.io Git - meshlink/commit - src/utcp.c
Fix potential incorrect destruction of channels.
authorGuus Sliepen <guus@meshlink.io>
Tue, 4 May 2021 19:51:50 +0000 (21:51 +0200)
committerGuus Sliepen <guus@meshlink.io>
Tue, 4 May 2021 19:54:57 +0000 (21:54 +0200)
commit2bd86439e6cee8742a01bb715461be62f6d33ac8
tree1e79fe9f186a1d9bba0d9489fe1c0a54cbfbd32e
parent932ce5bb0058ad5e757bd83476e297404f1bcb8b
Fix potential incorrect destruction of channels.

utcp_abort_all_connections() was called when a node is blacklisted or a
a node reconnects with a different session ID. In both cases, all active
channels should be closed. However, utcp_abort_all_connections() also freed
the UTCP connection object, which would cause a double free when the
application freed the corresponding meshlink_channel object.

Rename utcp_abort_all_connections() to utcp_reset_all_connections(), and
have it not invalidate any handles.
src/graph.c
src/meshlink.c
src/utcp.c
src/utcp.h