commit 734c16fe390eda336e56d3b20017335de206af13
parent 75259017b73b762a84307ba87d18b8ba989514d8
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Wed, 22 Oct 2025 18:45:38 +0200
-fix leaks
Diffstat:
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c
@@ -4340,10 +4340,14 @@ TEH_keys_management_get_keys_handler (const struct TEH_RequestHandler *rh,
.signkeys = json_array ()
};
+ GNUNET_assert (NULL != fbc.denoms);
+ GNUNET_assert (NULL != fbc.signkeys);
if ( (GNUNET_is_zero (&denom_rsa_sm_pub)) &&
(GNUNET_is_zero (&denom_cs_sm_pub)) )
{
/* Either IPC failed, or neither helper had any denominations configured. */
+ json_decref (fbc.denoms);
+ json_decref (fbc.signkeys);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_BAD_GATEWAY,
TALER_EC_EXCHANGE_DENOMINATION_HELPER_UNAVAILABLE,
@@ -4351,13 +4355,13 @@ TEH_keys_management_get_keys_handler (const struct TEH_RequestHandler *rh,
}
if (GNUNET_is_zero (&esign_sm_pub))
{
+ json_decref (fbc.denoms);
+ json_decref (fbc.signkeys);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_BAD_GATEWAY,
TALER_EC_EXCHANGE_SIGNKEY_HELPER_UNAVAILABLE,
NULL);
}
- GNUNET_assert (NULL != fbc.denoms);
- GNUNET_assert (NULL != fbc.signkeys);
GNUNET_CONTAINER_multihashmap_iterate (helpers.denom_keys,
&add_future_denomkey_cb,
&fbc);
@@ -4380,10 +4384,13 @@ TEH_keys_management_get_keys_handler (const struct TEH_RequestHandler *rh,
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Returning GET /management/keys response:\n");
if (NULL == reply)
+ {
+ GNUNET_break (0);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_GENERIC_JSON_ALLOCATION_FAILURE,
NULL);
+ }
GNUNET_assert (NULL == ksh->management_keys_reply);
ksh->management_keys_reply = reply;
}
diff --git a/src/util/secmod_rsa.c b/src/util/secmod_rsa.c
@@ -880,6 +880,7 @@ setup_key (struct DenominationKey *dk,
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
"write",
dk->filename);
+ GNUNET_free (dk->filename);
GNUNET_free (buf);
GNUNET_CRYPTO_rsa_private_key_free (priv);
GNUNET_CRYPTO_rsa_public_key_free (pub);