commit cd3071d864eda94562851796f5559e3e90c2d62f
parent 155966b731904f4979c51e0d0bd690d65c881042
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 9 Sep 2017 22:27:53 +0200
work on #5092, handle failure in easy case without asserting
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_responses.c b/src/backend/taler-merchant-httpd_responses.c
@@ -44,7 +44,11 @@ TMH_RESPONSE_make_json (const json_t *json)
json_str = json_dumps (json,
JSON_INDENT(2));
- GNUNET_assert (NULL != json_str);
+ if (NULL == json_str)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
resp = MHD_create_response_from_buffer (strlen (json_str),
json_str,
MHD_RESPMEM_MUST_FREE);
@@ -268,7 +272,7 @@ TMH_RESPONSE_reply_not_found (struct MHD_Connection *connection,
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_NOT_FOUND,
"{s:I, s:s}",
- "code", (json_int_t) ec,
+ "code", (json_int_t) ec,
"error", object);
}