]> git.meshlink.io Git - meshlink/blobdiff - src/net.c
terminate_connection(): only kill c->node->connection if it is pointing
[meshlink] / src / net.c
index 2565be113506502626af2c65ff49c7cb8cf7b61c..58db16e29f1d26778a6a649adcea0af1f49b448f 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -113,7 +113,7 @@ void terminate_connection(connection_t *c, bool report) {
 
        c->status.active = false;
 
-       if(c->node)
+       if(c->node && c->node->connection == c)
                c->node->connection = NULL;
 
        if(c->edge) {