check return value from taler_array_append_new()

This commit is contained in:
Christian Grothoff 2017-03-19 11:12:56 +01:00
parent ea1f2a1cd5
commit b0ba819cf4
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -54,12 +54,18 @@ fees_to_json (struct TALER_EXCHANGEDB_AggregateFees *af)
json_decref (a);
return NULL;
}
json_array_append_new (a,
json_pack ("{s:o, s:o, s:o, s:o}",
"wire_fee", TALER_JSON_from_amount (&af->wire_fee),
"start_date", GNUNET_JSON_from_time_abs (af->start_date),
"end_date", GNUNET_JSON_from_time_abs (af->end_date),
"sig", GNUNET_JSON_from_data_auto (&af->master_sig)));
if (0 !=
json_array_append_new (a,
json_pack ("{s:o, s:o, s:o, s:o}",
"wire_fee", TALER_JSON_from_amount (&af->wire_fee),
"start_date", GNUNET_JSON_from_time_abs (af->start_date),
"end_date", GNUNET_JSON_from_time_abs (af->end_date),
"sig", GNUNET_JSON_from_data_auto (&af->master_sig))))
{
GNUNET_break (0);
json_decref (a);
return NULL;
}
af = af->next;
}
return a;