From: Guus Sliepen Date: Fri, 8 Aug 2014 08:01:39 +0000 (+0200) Subject: Make sure outgoing->mesh is set. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=58f7363afa1960bbee1fa03f3d24db3b2a66cda8;p=meshlink Make sure outgoing->mesh is set. This caused a segmentation fault when cancelling outgoing connections. --- diff --git a/src/net.c b/src/net.c index 20b799ff..b368e505 100644 --- 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);