summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_refresh_common.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-11-19 20:56:53 +0100
committerChristian Grothoff <christian@grothoff.org>2021-11-19 20:56:53 +0100
commit52fe9d657bd54e622e8b87070c29ac0ffc27c575 (patch)
tree37d6b3cd84bff3e45b13b22b09d9ca938073c9fd /src/lib/exchange_api_refresh_common.c
parent7b5eb6137061128f987260ba681231e28ae260d5 (diff)
downloadexchange-52fe9d657bd54e622e8b87070c29ac0ffc27c575.tar.gz
exchange-52fe9d657bd54e622e8b87070c29ac0ffc27c575.tar.bz2
exchange-52fe9d657bd54e622e8b87070c29ac0ffc27c575.zip
-fix leaks and compiler warnings
Diffstat (limited to 'src/lib/exchange_api_refresh_common.c')
-rw-r--r--src/lib/exchange_api_refresh_common.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/exchange_api_refresh_common.c b/src/lib/exchange_api_refresh_common.c
index 520c80fd4..4f2a2cf18 100644
--- a/src/lib/exchange_api_refresh_common.c
+++ b/src/lib/exchange_api_refresh_common.c
@@ -198,11 +198,11 @@ serialize_melt_data (const struct MeltData *md)
GNUNET_JSON_pack_data_auto ("ps",
&md->fresh_coins[j][i]));
GNUNET_assert (0 ==
- json_array_append (planchet_secrets,
- ps));
+ json_array_append_new (planchet_secrets,
+ ps));
}
GNUNET_assert (0 ==
- json_array_append (
+ json_array_append_new (
fresh_coins,
GNUNET_JSON_PACK (
TALER_JSON_pack_denom_pub ("denom_pub",
@@ -299,6 +299,7 @@ TALER_EXCHANGE_deserialize_melt_data_ (const json_t *melt_data,
{
GNUNET_break (0);
ok = false;
+ GNUNET_JSON_parse_free (ispec);
break;
}
for (unsigned int j = 0; j<TALER_CNC_KAPPA; j++)
@@ -320,10 +321,12 @@ TALER_EXCHANGE_deserialize_melt_data_ (const json_t *melt_data,
break;
}
}
+ json_decref (planchet_secrets);
if (! ok)
break;
}
+ GNUNET_JSON_parse_free (spec);
if (! ok)
{
TALER_EXCHANGE_free_melt_data_ (md);