check json_pack return value, just to be nice

This commit is contained in:
Christian Grothoff 2017-05-07 14:07:48 +02:00
parent 76545519c6
commit 0e73c0d451
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
7 changed files with 43 additions and 4 deletions

View File

@ -187,6 +187,11 @@ TALER_EXCHANGE_admin_add_incoming (struct TALER_EXCHANGE_Handle *exchange,
"execution_date", GNUNET_JSON_from_time_abs (execution_date),
"sender_account_details", sender_account_details,
"transfer_details", transfer_details);
if (NULL == admin_obj)
{
GNUNET_break (0);
return NULL;
}
aai = GNUNET_new (struct TALER_EXCHANGE_AdminAddIncomingHandle);
aai->exchange = exchange;
aai->cb = res_cb;

View File

@ -463,6 +463,11 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
"wire_transfer_deadline", GNUNET_JSON_from_time_abs (wire_deadline),
"coin_sig", GNUNET_JSON_from_data_auto (coin_sig)
);
if (NULL == deposit_obj)
{
GNUNET_break (0);
return NULL;
}
dh = GNUNET_new (struct TALER_EXCHANGE_DepositHandle);
dh->exchange = exchange;

View File

@ -57,7 +57,7 @@ struct TALER_EXCHANGE_PaybackHandle
* Denomination key of the coin.
*/
const struct TALER_EXCHANGE_DenomPublicKey *pk;
/**
* Handle for the request.
*/
@ -306,7 +306,11 @@ TALER_EXCHANGE_payback (struct TALER_EXCHANGE_Handle *exchange,
"coin_sig", GNUNET_JSON_from_data_auto (&coin_sig),
"coin_blind_key_secret", GNUNET_JSON_from_data_auto (blinding_key)
);
GNUNET_assert (NULL != payback_obj);
if (NULL == payback_obj)
{
GNUNET_break (0);
return NULL;
}
ph = GNUNET_new (struct TALER_EXCHANGE_PaybackHandle);
ph->coin_pub = pr.coin_pub;

View File

@ -1337,6 +1337,11 @@ TALER_EXCHANGE_refresh_melt (struct TALER_EXCHANGE_Handle *exchange,
"melt_coin", melt_coin,
"coin_evs", coin_evs,
"transfer_pubs", transfer_pubs);
if (NULL == melt_obj)
{
GNUNET_break (0);
return NULL;
}
/* and now we can at last begin the actual request handling */
rmh = GNUNET_new (struct TALER_EXCHANGE_RefreshMeltHandle);
@ -1723,6 +1728,11 @@ TALER_EXCHANGE_refresh_reveal (struct TALER_EXCHANGE_Handle *exchange,
GNUNET_JSON_from_data_auto (&md->melt_session_hash),
"transfer_privs",
transfer_privs);
if (NULL == reveal_obj)
{
GNUNET_break (0);
return NULL;
}
/* finally, we can actually issue the request */
rrh = GNUNET_new (struct TALER_EXCHANGE_RefreshRevealHandle);

View File

@ -279,8 +279,12 @@ TALER_EXCHANGE_refund (struct TALER_EXCHANGE_Handle *exchange,
"merchant_pub", GNUNET_JSON_from_data_auto (&rr.merchant),
"merchant_sig", GNUNET_JSON_from_data_auto (&merchant_sig)
);
GNUNET_assert (NULL != refund_obj);
if (NULL == refund_obj)
{
GNUNET_break (0);
return NULL;
}
rh = GNUNET_new (struct TALER_EXCHANGE_RefundHandle);
rh->exchange = exchange;
rh->cb = cb;

View File

@ -1015,6 +1015,12 @@ TALER_EXCHANGE_reserve_withdraw (struct TALER_EXCHANGE_Handle *exchange,
"reserve_pub", GNUNET_JSON_from_data_auto (&wsh->reserve_pub),
"reserve_sig", GNUNET_JSON_from_data_auto (&reserve_sig));
GNUNET_free (coin_ev);
if (NULL == withdraw_obj)
{
GNUNET_break (0);
return NULL;
}
wsh->blinding_key = *blinding_key;
wsh->url = MAH_path_to_url (exchange, "/reserve/withdraw");

View File

@ -303,6 +303,11 @@ TALER_EXCHANGE_track_transaction (struct TALER_EXCHANGE_Handle *exchange,
"coin_pub", GNUNET_JSON_from_data_auto (coin_pub),
"merchant_pub", GNUNET_JSON_from_data_auto (&dtp.merchant),
"merchant_sig", GNUNET_JSON_from_data_auto (&merchant_sig));
if (NULL == deposit_wtid_obj)
{
GNUNET_break (0);
return NULL;
}
dwh = GNUNET_new (struct TALER_EXCHANGE_TrackTransactionHandle);
dwh->exchange = exchange;