From f2b20f3ad03c1af34ab40359e2c226457aa61a5b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 19 May 2016 16:24:29 +0200 Subject: more work towards fixing #4401 --- src/exchangedb/plugin_exchangedb_postgres.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/exchangedb/plugin_exchangedb_postgres.c') diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 44096f17..82585c06 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -3352,20 +3352,23 @@ postgres_get_melt_commitment (void *cls, return NULL; mc = GNUNET_new (struct TALER_EXCHANGEDB_MeltCommitment); mc->num_newcoins = rs.num_newcoins; - mc->denom_pubs = GNUNET_malloc (mc->num_newcoins * - sizeof (struct TALER_DenominationPublicKey)); + mc->denom_pubs = GNUNET_new_array (mc->num_newcoins, + struct TALER_DenominationPublicKey); if (GNUNET_OK != postgres_get_refresh_order (cls, session, session_hash, mc->num_newcoins, mc->denom_pubs)) + { + GNUNET_break (0); goto cleanup; + } for (cnc_index=0;cnc_indexcommit_coins[cnc_index] - = GNUNET_malloc (mc->num_newcoins * - sizeof (struct TALER_EXCHANGEDB_RefreshCommitCoin)); + = GNUNET_new_array (mc->num_newcoins, + struct TALER_EXCHANGEDB_RefreshCommitCoin); if (GNUNET_OK != postgres_get_refresh_commit_coins (cls, session, @@ -3373,19 +3376,26 @@ postgres_get_melt_commitment (void *cls, cnc_index, mc->num_newcoins, mc->commit_coins[cnc_index])) + { + GNUNET_break (0); goto cleanup; + } if (GNUNET_OK != postgres_get_refresh_commit_link (cls, session, session_hash, cnc_index, &mc->commit_links[cnc_index])) + { + GNUNET_break (0); goto cleanup; + } } return mc; cleanup: common_free_melt_commitment (cls, mc); + GNUNET_break (0); return NULL; } -- cgit v1.2.3