From f6bb0baa5ce9f714c13a014873405ac0d472023c Mon Sep 17 00:00:00 2001 From: David Barksdale Date: Sun, 29 Jan 2017 19:10:43 -0600 Subject: [PATCH] Don't pass NULL to destroy_route --- src/cadet/gnunet-service-cadet-new_core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cadet/gnunet-service-cadet-new_core.c b/src/cadet/gnunet-service-cadet-new_core.c index fda4a7b84..9cd6055c2 100644 --- a/src/cadet/gnunet-service-cadet-new_core.c +++ b/src/cadet/gnunet-service-cadet-new_core.c @@ -762,11 +762,12 @@ handle_connection_broken (void *cls, } /* We're just an intermediary peer, route the message along its path */ - route = get_route (&msg->cid); route_message (peer, &msg->cid, &msg->header); - destroy_route (route); + route = get_route (&msg->cid); + if (NULL != route) + destroy_route (route); /* FIXME: also destroy paths we MAY have up to the specified link! */ } @@ -813,11 +814,12 @@ handle_connection_destroy (void *cls, LOG (GNUNET_ERROR_TYPE_DEBUG, "Received CONNECTION_DESTROY for connection %s. Destroying route.\n", GNUNET_sh2s (&msg->cid.connection_of_tunnel)); - route = get_route (&msg->cid); route_message (peer, &msg->cid, &msg->header); - destroy_route (route); + route = get_route (&msg->cid); + if (NULL != route) + destroy_route (route); } -- 2.25.1