From 5514bc994bef5815fdde08b36df7939ee1cf71b6 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 12 Feb 2015 20:12:42 +0000 Subject: [PATCH] -fix memory leak of address on shutdown --- src/ats/ats_api_scheduling.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c index c1a80eb0a..333881a37 100644 --- a/src/ats/ats_api_scheduling.c +++ b/src/ats/ats_api_scheduling.c @@ -608,6 +608,7 @@ GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg, void GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh) { + struct GNUNET_ATS_AddressRecord *ar; unsigned int i; if (NULL != sh->mq) @@ -627,8 +628,12 @@ GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh) } for (i=0;isession_array_size;i++) { - GNUNET_free_non_null (sh->session_array[i]); - sh->session_array[i] = NULL; + if (NULL != (ar = sh->session_array[i])) + { + GNUNET_HELLO_address_free (ar->address); + GNUNET_free (ar); + sh->session_array[i] = NULL; + } } GNUNET_array_grow (sh->session_array, sh->session_array_size, -- 2.25.1