summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2020-05-05 13:03:19 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2020-05-05 13:03:19 +0200
commit50279a4d128d82f14e820cfaba729bf94b8216fe (patch)
tree268ffb6da7ce9673df91bb0bdaab8109c85c7fd8
parentb1e0f7d53b6d5b42477c173929041dcf52c8b03d (diff)
better cleanup
-rw-r--r--src/reclaim/plugin_rest_openid_connect.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/reclaim/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c
index c6fa40687..c9d995489 100644
--- a/src/reclaim/plugin_rest_openid_connect.c
+++ b/src/reclaim/plugin_rest_openid_connect.c
@@ -536,7 +536,6 @@ static void
cleanup_handle (struct RequestHandle *handle)
{
struct EgoEntry *ego_entry;
- struct EgoEntry *ego_tmp;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Cleaning up\n");
if (NULL != handle->timeout_task)
@@ -578,18 +577,19 @@ cleanup_handle (struct RequestHandle *handle)
json_decref (handle->oidc->response);
GNUNET_free (handle->oidc);
}
-if(NULL!=handle->attr_list)
+ if (NULL!=handle->attr_list)
GNUNET_RECLAIM_attribute_list_destroy (handle->attr_list);
-if(NULL!=handle->attests_list)
- GNUNET_RECLAIM_attestation_list_destroy (handle->attests_list);
+ if (NULL!=handle->attests_list)
+ GNUNET_RECLAIM_attestation_list_destroy (handle->attests_list);
- for (ego_entry = handle->ego_head; NULL != ego_entry;)
+ while (NULL != (ego_entry = handle->ego_head))
{
- ego_tmp = ego_entry;
- ego_entry = ego_entry->next;
- GNUNET_free (ego_tmp->identifier);
- GNUNET_free (ego_tmp->keystring);
- GNUNET_free (ego_tmp);
+ GNUNET_CONTAINER_DLL_remove (ego_entry,
+ handle->ego_head,
+ handle->ego_tail);
+ GNUNET_free (ego_entry->identifier);
+ GNUNET_free (ego_entry->keystring);
+ GNUNET_free (ego_entry);
}
GNUNET_free (handle);
}