diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-05-19 16:24:29 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-05-19 16:24:29 +0200 |
commit | f2b20f3ad03c1af34ab40359e2c226457aa61a5b (patch) | |
tree | 64626b12bf20a3b89c7a1ceb2695b601d6d94237 /src/exchangedb/plugin_exchangedb_postgres.c | |
parent | 763c8ab512b4d66dbd0caeb6cd68293b4f83edd8 (diff) | |
download | exchange-f2b20f3ad03c1af34ab40359e2c226457aa61a5b.tar.xz |
more work towards fixing #4401
Diffstat (limited to 'src/exchangedb/plugin_exchangedb_postgres.c')
-rw-r--r-- | src/exchangedb/plugin_exchangedb_postgres.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 44096f17f..82585c068 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_index<TALER_CNC_KAPPA;cnc_index++) { mc->commit_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; } |