aboutsummaryrefslogtreecommitdiff
path: root/src/nat
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-06 23:34:19 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-06 23:34:19 +0100
commita9c68a4fcb53d599dc5f0816f3330c169f2fe3a7 (patch)
tree3082c55c721ed566791a07aec456dcb0ca0c53d3 /src/nat
parenta7dd61673b1f4c06acb6844c856405721bb0511e (diff)
downloadgnunet-a9c68a4fcb53d599dc5f0816f3330c169f2fe3a7.tar.gz
gnunet-a9c68a4fcb53d599dc5f0816f3330c169f2fe3a7.zip
fix NPE if hole-external option is not set
Diffstat (limited to 'src/nat')
-rw-r--r--src/nat/gnunet-service-nat.c7
1 files 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,
853 int have_v4; 853 int have_v4;
854 854
855 /* (0) check if this impacts 'hole_external' */ 855 /* (0) check if this impacts 'hole_external' */
856 if (0 == strcasecmp (ch->hole_external, 856 if ( (NULL != ch->hole_external) &&
857 "AUTO")) 857 (0 == strcasecmp (ch->hole_external,
858 "AUTO")) )
858 { 859 {
859 struct LocalAddressList lal; 860 struct LocalAddressList lal;
860 struct sockaddr_in *s4; 861 struct sockaddr_in *s4;
@@ -2007,7 +2008,7 @@ client_disconnect_cb (void *cls,
2007 GNUNET_RESOLVER_request_cancel (ch->ext_dns); 2008 GNUNET_RESOLVER_request_cancel (ch->ext_dns);
2008 ch->ext_dns = NULL; 2009 ch->ext_dns = NULL;
2009 } 2010 }
2010 GNUNET_free (ch->hole_external); 2011 GNUNET_free_non_null (ch->hole_external);
2011 GNUNET_free (ch->section_name); 2012 GNUNET_free (ch->section_name);
2012 GNUNET_free (ch); 2013 GNUNET_free (ch);
2013} 2014}