fix potential NPE
authorChristian Grothoff <christian@grothoff.org>
Sun, 8 Jan 2017 19:09:59 +0000 (20:09 +0100)
committerChristian Grothoff <christian@grothoff.org>
Sun, 8 Jan 2017 19:09:59 +0000 (20:09 +0100)
src/nat/nat_api.c

index 826dbd57a33c09f37ff68ab9e13ebff8a491c006..5b4c39682b09b647f3a2d794c751cdf34a8145a2 100644 (file)
@@ -709,7 +709,11 @@ GNUNET_NAT_request_reversal (struct GNUNET_NAT_Handle *nh,
 void
 GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *nh)
 {
-  GNUNET_MQ_destroy (nh->mq);
+  if (NULL != nh->mq)
+  {
+    GNUNET_MQ_destroy (nh->mq);
+    nh->mq = NULL;
+  }
   GNUNET_free (nh->reg);
   GNUNET_free (nh);
 }