From 3ff5bad33e2abf67fa1fb015304c3c6bbd88a82b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 17 Feb 2019 00:13:14 +0100 Subject: fix memory leak: on repeated refresh reveal, we populated ev_sigs twice --- src/exchange/taler-exchange-httpd_refresh_reveal.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/exchange/taler-exchange-httpd_refresh_reveal.c') diff --git a/src/exchange/taler-exchange-httpd_refresh_reveal.c b/src/exchange/taler-exchange-httpd_refresh_reveal.c index 8062410e3..6eaa286d7 100644 --- a/src/exchange/taler-exchange-httpd_refresh_reveal.c +++ b/src/exchange/taler-exchange-httpd_refresh_reveal.c @@ -195,11 +195,16 @@ check_exists_cb (void *cls, GNUNET_break_op (0 == memcmp (tprivs, &rctx->transfer_privs, sizeof (struct TALER_TransferPrivateKeyP) * num_tprivs)); - rctx->ev_sigs = GNUNET_new_array (num_newcoins, - struct TALER_DenominationSignature); - for (unsigned int i=0;iev_sigs[i].rsa_signature - = GNUNET_CRYPTO_rsa_signature_dup (rrcs[i].coin_sig.rsa_signature); + /* We usually sign early (optimistic!), but in case we change that *and* + we do find the operation in the database, we could use this: */ + if (NULL == rctx->ev_sigs) + { + rctx->ev_sigs = GNUNET_new_array (num_newcoins, + struct TALER_DenominationSignature); + for (unsigned int i=0;iev_sigs[i].rsa_signature + = GNUNET_CRYPTO_rsa_signature_dup (rrcs[i].coin_sig.rsa_signature); + } } -- cgit v1.2.3