aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-05-09 13:28:01 +0200
committerChristian Grothoff <christian@grothoff.org>2017-05-09 13:28:01 +0200
commit7a259fb7bdbbab8e96bab5f8a1aa5cd49422a4ab (patch)
treeccdf05cf813ab6cbca8674c23014befc740312cc
parenta5fedfeeb88a7a9b8f13aeb49eb43a68a4d7582c (diff)
nicely handle error from json_dumps without assert
-rw-r--r--src/exchange-lib/exchange_api_payback.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/exchange-lib/exchange_api_payback.c b/src/exchange-lib/exchange_api_payback.c
index 8096e55f8..40b713857 100644
--- a/src/exchange-lib/exchange_api_payback.c
+++ b/src/exchange-lib/exchange_api_payback.c
@@ -321,10 +321,16 @@ TALER_EXCHANGE_payback (struct TALER_EXCHANGE_Handle *exchange,
ph->url = MAH_path_to_url (exchange, "/payback");
eh = curl_easy_init ();
- GNUNET_assert (NULL != (ph->json_enc =
- json_dumps (payback_obj,
- JSON_COMPACT)));
+ ph->json_enc = json_dumps (payback_obj,
+ JSON_COMPACT);
json_decref (payback_obj);
+ if (NULL == ph->json_enc)
+ {
+ GNUNET_break (0);
+ GNUNET_free (ph->url);
+ GNUNET_free (ph);
+ return NULL;
+ }
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"URL for payback: `%s'\n",
ph->url);