]> git.meshlink.io Git - meshlink/commitdiff
Make sure outgoing->mesh is set.
authorGuus Sliepen <guus@meshlink.io>
Fri, 8 Aug 2014 08:01:39 +0000 (10:01 +0200)
committerGuus Sliepen <guus@meshlink.io>
Fri, 8 Aug 2014 08:01:39 +0000 (10:01 +0200)
This caused a segmentation fault when cancelling outgoing connections.

src/net.c

index 20b799ff1cd1f8725abf9159ca653824aa37fe43..b368e505b763106429badb9a7ef1a855110bc06f 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -160,6 +160,7 @@ static void cond_add_connection(meshlink_handle_t *mesh, int rand_modulo, bool (
                        //the user will read this debug message "Autoconnecting to %s" that is misleading
                        logger(DEBUG_CONNECTIONS, LOG_INFO, "Autoconnecting to %s", n->name);
                        outgoing_t *outgoing = xzalloc(sizeof *outgoing);
+                       outgoing->mesh = mesh;
                        outgoing->name = xstrdup(n->name);
                        list_insert_tail(mesh->outgoings, outgoing);
                        setup_outgoing_connection(mesh, outgoing);