anastasis

Credential backup and recovery protocol and service
Log | Files | Refs | Submodules | README | LICENSE

commit 8dcf1134d4b9ce76baf9d7c3bd33a555a32f558e
parent b3ddcd0dbb6cf0db09f7bd156d73b3cb8e284e2d
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 27 Aug 2021 15:53:14 +0200

-more leaks

Diffstat:
Msrc/reducer/anastasis_api_backup_redux.c | 13+++++++++----
Msrc/reducer/anastasis_api_redux.c | 6+++++-
2 files changed, 14 insertions(+), 5 deletions(-)

diff --git 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); } diff --git a/src/reducer/anastasis_api_redux.c b/src/reducer/anastasis_api_redux.c @@ -349,7 +349,6 @@ free_config_request (struct ConfigRequest *cr) GNUNET_free (cr->business_name); for (unsigned int i = 0; i<cr->methods_length; i++) GNUNET_free (cr->methods[i].type); - GNUNET_free (cr->business_name); GNUNET_free (cr->methods); GNUNET_free (cr); } @@ -571,8 +570,13 @@ config_cb (void *cls, } else { + GNUNET_free (cr->currency); cr->currency = GNUNET_strdup (acfg->currency); + GNUNET_free (cr->business_name); cr->business_name = GNUNET_strdup (acfg->business_name); + for (unsigned int i = 0; i<cr->methods_length; i++) + GNUNET_free (cr->methods[i].type); + GNUNET_free (cr->methods); cr->methods = GNUNET_new_array (acfg->methods_length, struct AuthorizationMethodConfig); for (unsigned int i = 0; i<acfg->methods_length; i++)