gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-exchange] branch master updated: nicely handle error


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: nicely handle error from json_dumps without assert
Date: Tue, 09 May 2017 13:22:47 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 7a259fb  nicely handle error from json_dumps without assert
7a259fb is described below

commit 7a259fb7bdbbab8e96bab5f8a1aa5cd49422a4ab
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue May 9 13:28:01 2017 +0200

    nicely handle error from json_dumps without assert
---
 src/exchange-lib/exchange_api_payback.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/exchange-lib/exchange_api_payback.c 
b/src/exchange-lib/exchange_api_payback.c
index 8096e55..40b7138 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);

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]