From: Christian Grothoff Date: Tue, 4 Jun 2019 21:34:50 +0000 (+0200) Subject: fix use-after-free X-Git-Tag: v0.11.5~11 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1499f09f5b1a059dcbdd14881a94a19dfa7b13b9;p=oweals%2Fgnunet.git fix use-after-free --- diff --git a/src/ats/plugin_ats2_simple.c b/src/ats/plugin_ats2_simple.c index 7d5aebdfa..14bd2b99d 100644 --- a/src/ats/plugin_ats2_simple.c +++ b/src/ats/plugin_ats2_simple.c @@ -520,7 +520,6 @@ watch_cb (void *cls, hello->nt = nt; hello->peer = p; memcpy (&hello[1], addr, alen); - GNUNET_free (addr); GNUNET_CONTAINER_DLL_insert (p->h_head, p->h_tail, hello); /* check if sh for this HELLO already exists */ for (struct GNUNET_ATS_SessionHandle *sh = p->sh_head; NULL != sh; @@ -533,6 +532,7 @@ watch_cb (void *cls, hello->sh = sh; break; } + GNUNET_free (addr); if (NULL == p->task) p->task = GNUNET_SCHEDULER_add_now (&suggest_start_cb, p); }