From: Christian Grothoff Date: Thu, 12 Feb 2015 20:12:42 +0000 (+0000) Subject: -fix memory leak of address on shutdown X-Git-Tag: initial-import-from-subversion-38251~2327 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5514bc994bef5815fdde08b36df7939ee1cf71b6;p=oweals%2Fgnunet.git -fix memory leak of address on shutdown --- 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,