aboutsummaryrefslogtreecommitdiff
path: root/src/ats
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-06-04 23:34:50 +0200
committerChristian Grothoff <christian@grothoff.org>2019-06-04 23:34:50 +0200
commit1499f09f5b1a059dcbdd14881a94a19dfa7b13b9 (patch)
treebf5227c0109a79d889dde384bbb1926bacbca6cb /src/ats
parent9d337f76212e7616fa24bc57274fb51ff3983085 (diff)
downloadgnunet-1499f09f5b1a059dcbdd14881a94a19dfa7b13b9.tar.gz
gnunet-1499f09f5b1a059dcbdd14881a94a19dfa7b13b9.zip
fix use-after-free
Diffstat (limited to 'src/ats')
-rw-r--r--src/ats/plugin_ats2_simple.c2
1 files changed, 1 insertions, 1 deletions
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,
520 hello->nt = nt; 520 hello->nt = nt;
521 hello->peer = p; 521 hello->peer = p;
522 memcpy (&hello[1], addr, alen); 522 memcpy (&hello[1], addr, alen);
523 GNUNET_free (addr);
524 GNUNET_CONTAINER_DLL_insert (p->h_head, p->h_tail, hello); 523 GNUNET_CONTAINER_DLL_insert (p->h_head, p->h_tail, hello);
525 /* check if sh for this HELLO already exists */ 524 /* check if sh for this HELLO already exists */
526 for (struct GNUNET_ATS_SessionHandle *sh = p->sh_head; NULL != sh; 525 for (struct GNUNET_ATS_SessionHandle *sh = p->sh_head; NULL != sh;
@@ -533,6 +532,7 @@ watch_cb (void *cls,
533 hello->sh = sh; 532 hello->sh = sh;
534 break; 533 break;
535 } 534 }
535 GNUNET_free (addr);
536 if (NULL == p->task) 536 if (NULL == p->task)
537 p->task = GNUNET_SCHEDULER_add_now (&suggest_start_cb, p); 537 p->task = GNUNET_SCHEDULER_add_now (&suggest_start_cb, p);
538} 538}