From a9c68a4fcb53d599dc5f0816f3330c169f2fe3a7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 6 Jan 2017 23:34:19 +0100 Subject: fix NPE if hole-external option is not set --- src/nat/gnunet-service-nat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c index 2cb2b30ff..225d37874 100644 --- a/src/nat/gnunet-service-nat.c +++ b/src/nat/gnunet-service-nat.c @@ -853,8 +853,9 @@ notify_client_external_ipv4_change (void *cls, int have_v4; /* (0) check if this impacts 'hole_external' */ - if (0 == strcasecmp (ch->hole_external, - "AUTO")) + if ( (NULL != ch->hole_external) && + (0 == strcasecmp (ch->hole_external, + "AUTO")) ) { struct LocalAddressList lal; struct sockaddr_in *s4; @@ -2007,7 +2008,7 @@ client_disconnect_cb (void *cls, GNUNET_RESOLVER_request_cancel (ch->ext_dns); ch->ext_dns = NULL; } - GNUNET_free (ch->hole_external); + GNUNET_free_non_null (ch->hole_external); GNUNET_free (ch->section_name); GNUNET_free (ch); } -- cgit v1.2.3