terminate_connection(): Avoid use-after-free and double-free for
authorSven-Haegar Koch <haegar@sdinet.de>
Thu, 19 Apr 2012 22:24:38 +0000 (00:24 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Tue, 8 May 2012 14:16:59 +0000 (16:16 +0200)
already freed edge structure.

src/net.c

index db5743af2e9179915aca7686ac5c7fa497050746..2565be113506502626af2c65ff49c7cb8cf7b61c 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -121,6 +121,7 @@ void terminate_connection(connection_t *c, bool report) {
                        send_del_edge(everyone, c->edge);
 
                edge_del(c->edge);
+               c->edge = NULL;
 
                /* Run MST and SSSP algorithms */