diff options
Diffstat (limited to 'src/reducer/anastasis_api_backup_redux.c')
-rw-r--r-- | src/reducer/anastasis_api_backup_redux.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/reducer/anastasis_api_backup_redux.c b/src/reducer/anastasis_api_backup_redux.c index e025810..c8c0404 100644 --- a/src/reducer/anastasis_api_backup_redux.c +++ b/src/reducer/anastasis_api_backup_redux.c @@ -667,10 +667,13 @@ struct PolicyBuilder static void free_costs (struct Costs *costs) { - if (NULL == costs) - return; - free_costs (costs->next); - GNUNET_free (costs); + while (NULL != costs) + { + struct Costs *next = costs->next; + + GNUNET_free (costs); + costs = next; + } } @@ -1548,6 +1551,8 @@ clean_pb (struct PolicyBuilder *pb) GNUNET_CONTAINER_DLL_remove (p->pm_head, p->pm_tail, pm); + for (unsigned int i = 0; i<pb->req_methods; i++) + free_costs (pm->providers[i].usage_fee); GNUNET_free (pm->providers); GNUNET_free (pm); } |