diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-06-11 16:17:11 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-06-11 16:17:11 +0200 |
commit | 0e8cba34585ddd76aae0803b5d1721f8dd4cc51a (patch) | |
tree | aaef088476fd0bcb041b20a239a51c669f34d902 | |
parent | 0ced3cb8b36fae93fefbc5967adbb9f755d7604c (diff) |
fix memory leaks: json_array_append increments RC
-rw-r--r-- | src/lib/merchant_api_pay.c | 4 | ||||
-rw-r--r-- | src/lib/test_merchant_api.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/merchant_api_pay.c b/src/lib/merchant_api_pay.c index ffadd4b5..5a6127af 100644 --- a/src/lib/merchant_api_pay.c +++ b/src/lib/merchant_api_pay.c @@ -465,8 +465,8 @@ TALER_MERCHANT_pay_frontend (struct GNUNET_CURL_Context *ctx, "coin_sig", GNUNET_JSON_from_data_auto (&pc->coin_sig) ); GNUNET_assert (0 == - json_array_append (j_coins, - j_coin)); + json_array_append_new (j_coins, + j_coin)); } { /* Sanity check that total_amount and total_fee diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c index c6c6e292..dec44a19 100644 --- a/src/lib/test_merchant_api.c +++ b/src/lib/test_merchant_api.c @@ -1455,9 +1455,11 @@ interpreter_run (void *cls) if (NULL == cmd->details.contract.co) { GNUNET_break (0); + json_decref (proposal); fail (is); return; } + json_decref (proposal); return; } case OC_PAY: |