From 766fb6e2821dc84ccfe290e8906f12001e34043b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 11 Jun 2016 18:22:33 +0200 Subject: fixing more leaks --- src/exchange/taler-exchange-aggregator.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/exchange/taler-exchange-aggregator.c') diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c index e3262962c..d7b216e5f 100644 --- a/src/exchange/taler-exchange-aggregator.c +++ b/src/exchange/taler-exchange-aggregator.c @@ -432,12 +432,11 @@ deposit_cb (void *cls, return GNUNET_SYSERR; } au->row_id = row_id; - au->wire = (json_t *) wire; + au->wire = json_incref ((json_t *) wire); au->execution_time = GNUNET_TIME_absolute_get (); (void) GNUNET_TIME_round_abs (&au->execution_time); TALER_JSON_hash (au->wire, &au->h_wire); - json_incref (au->wire); GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, &au->wtid, sizeof (au->wtid)); @@ -774,8 +773,8 @@ run_aggregation (void *cls) GNUNET_free_non_null (au->additional_rows); if (NULL != au->wire) json_decref (au->wire); - au = NULL; GNUNET_free (au); + au = NULL; /* start again */ task = GNUNET_SCHEDULER_add_now (&run_aggregation, NULL); @@ -810,7 +809,10 @@ prepare_cb (void *cls, struct TALER_EXCHANGEDB_Session *session = au->session; if (NULL != au->wire) + { json_decref (au->wire); + au->wire = NULL; + } GNUNET_free_non_null (au->additional_rows); if (NULL == buf) { -- cgit v1.2.3