exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit e905e9e245149627bdecd14370c3bde3fd079375
parent edf4e5cdf7597478b13067a8be878439be456e90
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 16 May 2016 17:13:00 +0200

use GNUNET_new_array()

Diffstat:
Msrc/exchange/taler-exchange-httpd_db.c | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c @@ -1222,8 +1222,8 @@ check_commitment (struct MHD_Connection *connection, } /* Check that the commitments for all new coins were correct */ - commit_coins = GNUNET_malloc (num_newcoins * - sizeof (struct TALER_EXCHANGEDB_RefreshCommitCoin)); + commit_coins = GNUNET_new_array (num_newcoins, + struct TALER_EXCHANGEDB_RefreshCommitCoin); if (GNUNET_OK != TMH_plugin->get_refresh_commit_coins (TMH_plugin->cls, @@ -1471,8 +1471,8 @@ TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection, "session_hash"); if (GNUNET_SYSERR == res) return TMH_RESPONSE_reply_internal_db_error (connection); - denom_pubs = GNUNET_malloc (refresh_session.num_newcoins * - sizeof (struct TALER_DenominationPublicKey)); + denom_pubs = GNUNET_new_array (refresh_session.num_newcoins, + struct TALER_DenominationPublicKey); if (GNUNET_OK != TMH_plugin->get_refresh_order (TMH_plugin->cls, session, @@ -1514,10 +1514,10 @@ TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection, } /* Client request OK, start transaction */ - commit_coins = GNUNET_malloc (refresh_session.num_newcoins * - sizeof (struct TALER_EXCHANGEDB_RefreshCommitCoin)); - ev_sigs = GNUNET_malloc (refresh_session.num_newcoins * - sizeof (struct TALER_DenominationSignature)); + commit_coins = GNUNET_new_array (refresh_session.num_newcoins, + struct TALER_EXCHANGEDB_RefreshCommitCoin); + ev_sigs = GNUNET_new_array (refresh_session.num_newcoins, + struct TALER_DenominationSignature); res = execute_refresh_reveal_transaction (connection, session, session_hash,