From 1499f09f5b1a059dcbdd14881a94a19dfa7b13b9 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 4 Jun 2019 23:34:50 +0200 Subject: [PATCH] fix use-after-free --- src/ats/plugin_ats2_simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.25.1