summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-12 20:12:42 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-12 20:12:42 +0000
commit5514bc994bef5815fdde08b36df7939ee1cf71b6 (patch)
tree9ece29f6e21e257dbc5ff258c4773999916e1ab2 /src
parentbc2da28e8bfac47c9a0b0529a487369daff066a0 (diff)
-fix memory leak of address on shutdown
Diffstat (limited to 'src')
-rw-r--r--src/ats/ats_api_scheduling.c9
1 files 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;i<sh->session_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,