diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-06 23:34:19 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-06 23:34:19 +0100 |
commit | a9c68a4fcb53d599dc5f0816f3330c169f2fe3a7 (patch) | |
tree | 3082c55c721ed566791a07aec456dcb0ca0c53d3 /src/nat | |
parent | a7dd61673b1f4c06acb6844c856405721bb0511e (diff) |
fix NPE if hole-external option is not set
Diffstat (limited to 'src/nat')
-rw-r--r-- | src/nat/gnunet-service-nat.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c index 2cb2b30ffd..225d378743 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); } |