diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-05-05 13:40:07 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-05-05 13:40:07 +0200 |
commit | 9d3d1ad5ae075504a74d6579ee0077a3ca46c41a (patch) | |
tree | b73ae7b77dfe7b2ffff01024bfa8fb89d6c99dac /src/reclaim/plugin_rest_openid_connect.c | |
parent | 50279a4d128d82f14e820cfaba729bf94b8216fe (diff) | |
download | gnunet-9d3d1ad5ae075504a74d6579ee0077a3ca46c41a.tar.gz gnunet-9d3d1ad5ae075504a74d6579ee0077a3ca46c41a.zip |
better deletion of ego handling
Diffstat (limited to 'src/reclaim/plugin_rest_openid_connect.c')
-rw-r--r-- | src/reclaim/plugin_rest_openid_connect.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/reclaim/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c index c9d995489..b6f82df84 100644 --- a/src/reclaim/plugin_rest_openid_connect.c +++ b/src/reclaim/plugin_rest_openid_connect.c | |||
@@ -2263,13 +2263,16 @@ list_ego (void *cls, | |||
2263 | for (ego_entry = handle->ego_head; NULL != ego_entry; | 2263 | for (ego_entry = handle->ego_head; NULL != ego_entry; |
2264 | ego_entry = ego_entry->next) | 2264 | ego_entry = ego_entry->next) |
2265 | { | 2265 | { |
2266 | if (ego_entry->ego == ego) | 2266 | if (ego_entry->ego != ego) |
2267 | break; | 2267 | continue; |
2268 | } | ||
2269 | if (NULL != ego_entry) | ||
2270 | GNUNET_CONTAINER_DLL_remove (handle->ego_head, | 2268 | GNUNET_CONTAINER_DLL_remove (handle->ego_head, |
2271 | handle->ego_tail, | 2269 | handle->ego_tail, |
2272 | ego_entry); | 2270 | ego_entry); |
2271 | GNUNET_free (ego_entry->identifier); | ||
2272 | GNUNET_free (ego_entry->keystring); | ||
2273 | GNUNET_free (ego_entry); | ||
2274 | return; | ||
2275 | } | ||
2273 | } | 2276 | } |
2274 | } | 2277 | } |
2275 | 2278 | ||
@@ -2283,7 +2286,8 @@ rest_identity_process_request (struct GNUNET_REST_RequestHandle *rest_handle, | |||
2283 | 2286 | ||
2284 | handle->oidc = GNUNET_new (struct OIDC_Variables); | 2287 | handle->oidc = GNUNET_new (struct OIDC_Variables); |
2285 | if (NULL == OIDC_cookie_jar_map) | 2288 | if (NULL == OIDC_cookie_jar_map) |
2286 | OIDC_cookie_jar_map = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); | 2289 | OIDC_cookie_jar_map = GNUNET_CONTAINER_multihashmap_create (10, |
2290 | GNUNET_NO); | ||
2287 | if (NULL == OIDC_access_token_map) | 2291 | if (NULL == OIDC_access_token_map) |
2288 | OIDC_access_token_map = | 2292 | OIDC_access_token_map = |
2289 | GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); | 2293 | GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); |
@@ -2308,11 +2312,11 @@ rest_identity_process_request (struct GNUNET_REST_RequestHandle *rest_handle, | |||
2308 | 2312 | ||
2309 | 2313 | ||
2310 | /** | 2314 | /** |
2311 | * Entry point for the plugin. | 2315 | * Entry point for the plugin. |
2312 | * | 2316 | * |
2313 | * @param cls Config info | 2317 | * @param cls Config info |
2314 | * @return NULL on error, otherwise the plugin context | 2318 | * @return NULL on error, otherwise the plugin context |
2315 | */ | 2319 | */ |
2316 | void * | 2320 | void * |
2317 | libgnunet_plugin_rest_openid_connect_init (void *cls) | 2321 | libgnunet_plugin_rest_openid_connect_init (void *cls) |
2318 | { | 2322 | { |
@@ -2321,7 +2325,7 @@ libgnunet_plugin_rest_openid_connect_init (void *cls) | |||
2321 | 2325 | ||
2322 | cfg = cls; | 2326 | cfg = cls; |
2323 | if (NULL != plugin.cfg) | 2327 | if (NULL != plugin.cfg) |
2324 | return NULL; /* can only initialize once! */ | 2328 | return NULL; /* can only initialize once! */ |
2325 | memset (&plugin, 0, sizeof(struct Plugin)); | 2329 | memset (&plugin, 0, sizeof(struct Plugin)); |
2326 | plugin.cfg = cfg; | 2330 | plugin.cfg = cfg; |
2327 | api = GNUNET_new (struct GNUNET_REST_Plugin); | 2331 | api = GNUNET_new (struct GNUNET_REST_Plugin); |
@@ -2343,11 +2347,11 @@ libgnunet_plugin_rest_openid_connect_init (void *cls) | |||
2343 | 2347 | ||
2344 | 2348 | ||
2345 | /** | 2349 | /** |
2346 | * Exit point from the plugin. | 2350 | * Exit point from the plugin. |
2347 | * | 2351 | * |
2348 | * @param cls the plugin context (as returned by "init") | 2352 | * @param cls the plugin context (as returned by "init") |
2349 | * @return always NULL | 2353 | * @return always NULL |
2350 | */ | 2354 | */ |
2351 | void * | 2355 | void * |
2352 | libgnunet_plugin_rest_openid_connect_done (void *cls) | 2356 | libgnunet_plugin_rest_openid_connect_done (void *cls) |
2353 | { | 2357 | { |
@@ -2361,7 +2365,8 @@ libgnunet_plugin_rest_openid_connect_done (void *cls) | |||
2361 | hashmap_it = | 2365 | hashmap_it = |
2362 | GNUNET_CONTAINER_multihashmap_iterator_create (OIDC_cookie_jar_map); | 2366 | GNUNET_CONTAINER_multihashmap_iterator_create (OIDC_cookie_jar_map); |
2363 | while (GNUNET_YES == | 2367 | while (GNUNET_YES == |
2364 | GNUNET_CONTAINER_multihashmap_iterator_next (hashmap_it, NULL, value)) | 2368 | GNUNET_CONTAINER_multihashmap_iterator_next (hashmap_it, NULL, |
2369 | value)) | ||
2365 | GNUNET_free_non_null (value); | 2370 | GNUNET_free_non_null (value); |
2366 | GNUNET_CONTAINER_multihashmap_iterator_destroy (hashmap_it); | 2371 | GNUNET_CONTAINER_multihashmap_iterator_destroy (hashmap_it); |
2367 | GNUNET_CONTAINER_multihashmap_destroy (OIDC_cookie_jar_map); | 2372 | GNUNET_CONTAINER_multihashmap_destroy (OIDC_cookie_jar_map); |
@@ -2369,7 +2374,8 @@ libgnunet_plugin_rest_openid_connect_done (void *cls) | |||
2369 | hashmap_it = | 2374 | hashmap_it = |
2370 | GNUNET_CONTAINER_multihashmap_iterator_create (OIDC_access_token_map); | 2375 | GNUNET_CONTAINER_multihashmap_iterator_create (OIDC_access_token_map); |
2371 | while (GNUNET_YES == | 2376 | while (GNUNET_YES == |
2372 | GNUNET_CONTAINER_multihashmap_iterator_next (hashmap_it, NULL, value)) | 2377 | GNUNET_CONTAINER_multihashmap_iterator_next (hashmap_it, NULL, |
2378 | value)) | ||
2373 | GNUNET_free_non_null (value); | 2379 | GNUNET_free_non_null (value); |
2374 | GNUNET_CONTAINER_multihashmap_destroy (OIDC_access_token_map); | 2380 | GNUNET_CONTAINER_multihashmap_destroy (OIDC_access_token_map); |
2375 | GNUNET_CONTAINER_multihashmap_iterator_destroy (hashmap_it); | 2381 | GNUNET_CONTAINER_multihashmap_iterator_destroy (hashmap_it); |