-fix more memory leaks

This commit is contained in:
Christian Grothoff 2023-02-19 13:14:16 +01:00
parent fe79f6af9c
commit d49a0536ad
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -1905,6 +1905,7 @@ create_krd (struct TEH_KeyStateHandle *ksh,
json_t *extensions = json_object (); json_t *extensions = json_object ();
bool has_extensions = false; bool has_extensions = false;
GNUNET_assert (NULL != extensions);
/* Fill in the configurations of the enabled extensions */ /* Fill in the configurations of the enabled extensions */
for (const struct TALER_Extensions *iter = TALER_extensions_get_head (); for (const struct TALER_Extensions *iter = TALER_extensions_get_head ();
NULL != iter && NULL != iter->extension; NULL != iter && NULL != iter->extension;
@ -1938,7 +1939,7 @@ create_krd (struct TEH_KeyStateHandle *ksh,
json_t *sig; json_t *sig;
int r; int r;
r = json_object_set ( r = json_object_set_new (
keys, keys,
"extensions", "extensions",
extensions); extensions);
@ -2258,7 +2259,7 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
if (age_restricted) if (age_restricted)
{ {
int r = json_object_set (group->json, int r = json_object_set_new (group->json,
"age_mask", "age_mask",
json_integer (meta.age_mask.bits)); json_integer (meta.age_mask.bits));
GNUNET_assert (0 == r); GNUNET_assert (0 == r);
@ -2268,8 +2269,9 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
list = json_array (); list = json_array ();
GNUNET_assert (NULL != list); GNUNET_assert (NULL != list);
GNUNET_assert (0 == GNUNET_assert (0 ==
json_object_set (group->json, denoms_key, list)); json_object_set_new (group->json,
denoms_key,
list));
GNUNET_assert ( GNUNET_assert (
GNUNET_OK == GNUNET_OK ==
GNUNET_CONTAINER_multihashmap_put (denominations_by_group, GNUNET_CONTAINER_multihashmap_put (denominations_by_group,
@ -2353,7 +2355,7 @@ finish_keys_response (struct TEH_KeyStateHandle *ksh)
{ {
/* Add the XOR over all hashes of denominations in this group to the group */ /* Add the XOR over all hashes of denominations in this group to the group */
GNUNET_assert (0 == GNUNET_assert (0 ==
json_object_set ( json_object_set_new (
group->json, group->json,
"hash", "hash",
GNUNET_JSON_PACK ( GNUNET_JSON_PACK (