From 869b3a7feb1e130a374540526f24107ded7fb1f9 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 8 Jan 2017 20:09:59 +0100 Subject: [PATCH] fix potential NPE --- src/nat/nat_api.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nat/nat_api.c b/src/nat/nat_api.c index 826dbd57a..5b4c39682 100644 --- a/src/nat/nat_api.c +++ b/src/nat/nat_api.c @@ -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); } -- 2.25.1