diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-06-04 23:59:22 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-06-04 23:59:22 +0200 |
commit | 761cdce49f33607b0e8e1ef0c4275bf8d7e82c02 (patch) | |
tree | f26c87db6b3f17632c8cd6faab5ac5a98872d91b /src/reclaim | |
parent | 1499f09f5b1a059dcbdd14881a94a19dfa7b13b9 (diff) | |
download | gnunet-761cdce49f33607b0e8e1ef0c4275bf8d7e82c02.tar.gz gnunet-761cdce49f33607b0e8e1ef0c4275bf8d7e82c02.zip |
fix memory issues
Diffstat (limited to 'src/reclaim')
-rw-r--r-- | src/reclaim/gnunet-service-reclaim_tickets.c | 1 | ||||
-rw-r--r-- | src/reclaim/plugin_rest_openid_connect.c | 10 | ||||
-rw-r--r-- | src/reclaim/reclaim_api.c | 6 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/reclaim/gnunet-service-reclaim_tickets.c b/src/reclaim/gnunet-service-reclaim_tickets.c index 9a595447d..182cb6186 100644 --- a/src/reclaim/gnunet-service-reclaim_tickets.c +++ b/src/reclaim/gnunet-service-reclaim_tickets.c | |||
@@ -719,6 +719,7 @@ RECLAIM_TICKETS_revoke (const struct GNUNET_RECLAIM_Ticket *ticket, | |||
719 | rvk, | 719 | rvk, |
720 | &revoke_attrs_cb, | 720 | &revoke_attrs_cb, |
721 | rvk); | 721 | rvk); |
722 | GNUNET_free (label); | ||
722 | return rvk; | 723 | return rvk; |
723 | } | 724 | } |
724 | 725 | ||
diff --git a/src/reclaim/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c index 912350248..03e037261 100644 --- a/src/reclaim/plugin_rest_openid_connect.c +++ b/src/reclaim/plugin_rest_openid_connect.c | |||
@@ -552,7 +552,6 @@ cleanup_handle (struct RequestHandle *handle) | |||
552 | GNUNET_free (ego_tmp->keystring); | 552 | GNUNET_free (ego_tmp->keystring); |
553 | GNUNET_free (ego_tmp); | 553 | GNUNET_free (ego_tmp); |
554 | } | 554 | } |
555 | GNUNET_free_non_null (handle->attr_it); | ||
556 | GNUNET_free (handle); | 555 | GNUNET_free (handle); |
557 | } | 556 | } |
558 | 557 | ||
@@ -871,7 +870,6 @@ oidc_ticket_issue_cb (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket) | |||
871 | char *code_string; | 870 | char *code_string; |
872 | 871 | ||
873 | handle->idp_op = NULL; | 872 | handle->idp_op = NULL; |
874 | handle->ticket = *ticket; | ||
875 | if (NULL == ticket) | 873 | if (NULL == ticket) |
876 | { | 874 | { |
877 | handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_SERVER_ERROR); | 875 | handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_SERVER_ERROR); |
@@ -879,6 +877,7 @@ oidc_ticket_issue_cb (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket) | |||
879 | GNUNET_SCHEDULER_add_now (&do_redirect_error, handle); | 877 | GNUNET_SCHEDULER_add_now (&do_redirect_error, handle); |
880 | return; | 878 | return; |
881 | } | 879 | } |
880 | handle->ticket = *ticket; | ||
882 | ticket_str = | 881 | ticket_str = |
883 | GNUNET_STRINGS_data_to_string_alloc (&handle->ticket, | 882 | GNUNET_STRINGS_data_to_string_alloc (&handle->ticket, |
884 | sizeof (struct GNUNET_RECLAIM_Ticket)); | 883 | sizeof (struct GNUNET_RECLAIM_Ticket)); |
@@ -1147,6 +1146,7 @@ lookup_redirect_uri_result (void *cls, | |||
1147 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1146 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1148 | "Redirect uri %s contains client_id but is malformed\n", | 1147 | "Redirect uri %s contains client_id but is malformed\n", |
1149 | tmp); | 1148 | tmp); |
1149 | GNUNET_free (tmp); | ||
1150 | continue; | 1150 | continue; |
1151 | } | 1151 | } |
1152 | *pos = '\0'; | 1152 | *pos = '\0'; |
@@ -1158,6 +1158,7 @@ lookup_redirect_uri_result (void *cls, | |||
1158 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1158 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1159 | "Redirect uri %s contains client_id but is malformed\n", | 1159 | "Redirect uri %s contains client_id but is malformed\n", |
1160 | tmp); | 1160 | tmp); |
1161 | GNUNET_free (tmp); | ||
1161 | continue; | 1162 | continue; |
1162 | } | 1163 | } |
1163 | *pos = '\0'; | 1164 | *pos = '\0'; |
@@ -1858,7 +1859,8 @@ userinfo_endpoint (struct GNUNET_REST_RequestHandle *con_handle, | |||
1858 | // split header in "Bearer" and access_token | 1859 | // split header in "Bearer" and access_token |
1859 | authorization = GNUNET_strdup (authorization); | 1860 | authorization = GNUNET_strdup (authorization); |
1860 | authorization_type = strtok (authorization, delimiter); | 1861 | authorization_type = strtok (authorization, delimiter); |
1861 | if (0 != strcmp ("Bearer", authorization_type)) | 1862 | if ((NULL == authorization_type) || |
1863 | (0 != strcmp ("Bearer", authorization_type))) | ||
1862 | { | 1864 | { |
1863 | handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_INVALID_TOKEN); | 1865 | handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_INVALID_TOKEN); |
1864 | handle->edesc = GNUNET_strdup ("No Access Token"); | 1866 | handle->edesc = GNUNET_strdup ("No Access Token"); |
@@ -1999,6 +2001,7 @@ list_ego (void *cls, | |||
1999 | init_cont (handle); | 2001 | init_cont (handle); |
2000 | return; | 2002 | return; |
2001 | } | 2003 | } |
2004 | GNUNET_assert (NULL != ego); | ||
2002 | if (ID_REST_STATE_INIT == handle->state) | 2005 | if (ID_REST_STATE_INIT == handle->state) |
2003 | { | 2006 | { |
2004 | ego_entry = GNUNET_new (struct EgoEntry); | 2007 | ego_entry = GNUNET_new (struct EgoEntry); |
@@ -2140,6 +2143,7 @@ libgnunet_plugin_rest_openid_connect_done (void *cls) | |||
2140 | while (GNUNET_YES == | 2143 | while (GNUNET_YES == |
2141 | GNUNET_CONTAINER_multihashmap_iterator_next (hashmap_it, NULL, value)) | 2144 | GNUNET_CONTAINER_multihashmap_iterator_next (hashmap_it, NULL, value)) |
2142 | GNUNET_free_non_null (value); | 2145 | GNUNET_free_non_null (value); |
2146 | GNUNET_CONTAINER_multihashmap_iterator_destroy (hashmap_it); | ||
2143 | GNUNET_CONTAINER_multihashmap_destroy (OIDC_cookie_jar_map); | 2147 | GNUNET_CONTAINER_multihashmap_destroy (OIDC_cookie_jar_map); |
2144 | 2148 | ||
2145 | hashmap_it = | 2149 | hashmap_it = |
diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c index 5a9b9d4a9..b0bedfac5 100644 --- a/src/reclaim/reclaim_api.c +++ b/src/reclaim/reclaim_api.c | |||
@@ -505,12 +505,10 @@ handle_consume_ticket_result (void *cls, | |||
505 | op->ar_cb (op->cls, &msg->identity, le->claim); | 505 | op->ar_cb (op->cls, &msg->identity, le->claim); |
506 | GNUNET_RECLAIM_ATTRIBUTE_list_destroy (attrs); | 506 | GNUNET_RECLAIM_ATTRIBUTE_list_destroy (attrs); |
507 | } | 507 | } |
508 | } | ||
509 | if (NULL != op) { | ||
510 | op->ar_cb (op->cls, NULL, NULL); | 508 | op->ar_cb (op->cls, NULL, NULL); |
511 | GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op); | ||
512 | free_op (op); | ||
513 | } | 509 | } |
510 | GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op); | ||
511 | free_op (op); | ||
514 | return; | 512 | return; |
515 | } | 513 | } |
516 | GNUNET_assert (0); | 514 | GNUNET_assert (0); |