diff options
Diffstat (limited to 'src/exchange')
-rw-r--r-- | src/exchange/taler-exchange-httpd.c | 9 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_keys.c | 19 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_management_post_keys.c | 2 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_wire.c | 14 |
4 files changed, 24 insertions, 20 deletions
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c index 4208e4ca8..3b8d6ed82 100644 --- a/src/exchange/taler-exchange-httpd.c +++ b/src/exchange/taler-exchange-httpd.c @@ -381,7 +381,8 @@ proceed_with_handler (const struct TEH_RequestHandler *rh, GNUNET_assert (NULL == root); return MHD_NO; /* bad upload, could not even generate error */ } - if ( (GNUNET_NO == res) || (NULL == root) ) + if ( (GNUNET_NO == res) || + (NULL == root) ) { GNUNET_assert (NULL == root); return MHD_YES; /* so far incomplete upload or parser error */ @@ -427,8 +428,7 @@ proceed_with_handler (const struct TEH_RequestHandler *rh, rh->url, url); GNUNET_break_op (0); - if (NULL != root) - json_decref (root); + json_decref (root); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, TALER_EC_EXCHANGE_GENERIC_WRONG_NUMBER_OF_SEGMENTS, @@ -454,8 +454,7 @@ proceed_with_handler (const struct TEH_RequestHandler *rh, connection, args); } - if (NULL != root) - json_decref (root); + json_decref (root); return ret; } diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c index c85b2c568..df49b93f9 100644 --- a/src/exchange/taler-exchange-httpd_keys.c +++ b/src/exchange/taler-exchange-httpd_keys.c @@ -519,7 +519,7 @@ check_esign_sm_pub (const struct TALER_SecurityModulePublicKeyP *sm_pub) * Helper function for #destroy_key_helpers to free all entries * in the `denom_keys` map. * - * @param cls the `struct HelperState` + * @param cls the `struct HelperDenomination` * @param h_denom_pub hash of the denomination public key * @param value the `struct HelperDenomination` to release * @return #GNUNET_OK (continue to iterate) @@ -544,7 +544,7 @@ free_denom_cb (void *cls, * Helper function for #destroy_key_helpers to free all entries * in the `esign_keys` map. * - * @param cls the `struct HelperState` + * @param cls the `struct HelperSignkey` * @param pid unused, matches the exchange public key * @param value the `struct HelperSignkey` to release * @return #GNUNET_OK (continue to iterate) @@ -582,11 +582,6 @@ destroy_key_helpers (struct HelperState *hs) hs); GNUNET_CONTAINER_multipeermap_destroy (hs->esign_keys); hs->esign_keys = NULL; - if (NULL != hs->management_keys_reply) - { - json_decref (hs->management_keys_reply); - hs->management_keys_reply = NULL; - } if (NULL != hs->dh) { TALER_CRYPTO_helper_denom_disconnect (hs->dh); @@ -597,6 +592,11 @@ destroy_key_helpers (struct HelperState *hs) TALER_CRYPTO_helper_esign_disconnect (hs->esh); hs->esh = NULL; } + if (NULL != hs->management_keys_reply) + { + json_decref (hs->management_keys_reply); + hs->management_keys_reply = NULL; + } } @@ -1777,7 +1777,7 @@ get_key_state (bool management_only) GNUNET_break (0); if (NULL != ksh) destroy_key_state (ksh, - false); + (NULL == old_ksh)); return NULL; } if (NULL != old_ksh) @@ -2463,9 +2463,6 @@ TEH_keys_management_get_handler (const struct TEH_RequestHandler *rh, GNUNET_JSON_from_data_auto (&esign_sm_pub)); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Returning GET /management/keys response:\n"); - json_dumpf (reply, - stderr, - JSON_INDENT (2)); if (NULL == reply) return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, diff --git a/src/exchange/taler-exchange-httpd_management_post_keys.c b/src/exchange/taler-exchange-httpd_management_post_keys.c index 1e7936535..18f4c1b3e 100644 --- a/src/exchange/taler-exchange-httpd_management_post_keys.c +++ b/src/exchange/taler-exchange-httpd_management_post_keys.c @@ -434,6 +434,8 @@ TEH_handler_management_post_keys ( &ret, &add_keys, &akc); + GNUNET_free (akc.d_sigs); + GNUNET_free (akc.s_sigs); if (qs < 0) return ret; TEH_keys_update_states (); diff --git a/src/exchange/taler-exchange-httpd_wire.c b/src/exchange/taler-exchange-httpd_wire.c index 1942c7e4e..e01355c60 100644 --- a/src/exchange/taler-exchange-httpd_wire.c +++ b/src/exchange/taler-exchange-httpd_wire.c @@ -280,12 +280,18 @@ build_wire_state (void) } } wire_reply = json_pack ( - "{s:O, s:O, s:o}", - "accounts", wire_accounts_array, - "fees", wire_fee_object, + "{s:o, s:o, s:o}", + "accounts", + wire_accounts_array, + "fees", + wire_fee_object, "master_public_key", GNUNET_JSON_from_data_auto (&TEH_master_public_key)); - GNUNET_assert (NULL != wire_reply); + if (NULL == wire_reply) + { + GNUNET_break (0); + return NULL; + } { struct WireStateHandle *wsh; |