gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix leak


From: gnunet
Subject: [taler-exchange] branch master updated: fix leak
Date: Mon, 20 Jan 2020 02:00:57 +0100

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 f45b1c91 fix leak
f45b1c91 is described below

commit f45b1c912b5b7678df1c59afbbaab80cadd4c770
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Jan 20 02:00:55 2020 +0100

    fix leak
---
 src/exchange/taler-exchange-httpd_refresh_link.c | 53 +++++++++++-------------
 1 file changed, 25 insertions(+), 28 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_refresh_link.c 
b/src/exchange/taler-exchange-httpd_refresh_link.c
index c3d36e29..5e436091 100644
--- a/src/exchange/taler-exchange-httpd_refresh_link.c
+++ b/src/exchange/taler-exchange-httpd_refresh_link.c
@@ -59,7 +59,6 @@ struct HTD_Context
  * information for a given coin.  Gets the linkage data and
  * builds the reply for the client.
  *
- *
  * @param cls closure, a `struct HTD_Context`
  * @param transfer_pub public transfer key for the session
  * @param ldl link data related to @a transfer_pub
@@ -84,35 +83,33 @@ handle_link_data (void *cls,
   {
     json_t *obj;
 
-    if (NULL == (obj = json_object ()))
-      goto fail;
-    json_object_set_new (obj,
-                         "denom_pub",
-                         GNUNET_JSON_from_rsa_public_key (
-                           pos->denom_pub.rsa_public_key));
-    json_object_set_new (obj,
-                         "ev_sig",
-                         GNUNET_JSON_from_rsa_signature (
-                           pos->ev_sig.rsa_signature));
-    json_object_set_new (obj,
-                         "link_sig",
-                         GNUNET_JSON_from_data_auto 
(&pos->orig_coin_link_sig));
-    if (0 !=
-        json_array_append_new (list,
-                               obj))
+    obj = json_pack ("{s:o, s:o, s:o}",
+                     "denom_pub",
+                     GNUNET_JSON_from_rsa_public_key
+                       (pos->denom_pub.rsa_public_key),
+                     "ev_sig",
+                     GNUNET_JSON_from_rsa_signature
+                       (pos->ev_sig.rsa_signature),
+                     "link_sig",
+                     GNUNET_JSON_from_data_auto (&pos->orig_coin_link_sig));
+    if ( (NULL == obj) ||
+         (0 !=
+          json_array_append_new (list,
+                                 obj)) )
+    {
+      json_decref (list);
       goto fail;
+    }
   }
-  if (NULL == (root = json_object ()))
-    goto fail;
-  json_object_set_new (root,
-                       "new_coins",
-                       list);
-  json_object_set_new (root,
-                       "transfer_pub",
-                       GNUNET_JSON_from_data_auto (transfer_pub));
-  if (0 !=
-      json_array_append_new (ctx->mlist,
-                             root))
+  root = json_pack ("{s:o, s:o}",
+                    "new_coins",
+                    list,
+                    "transfer_pub",
+                    GNUNET_JSON_from_data_auto (transfer_pub));
+  if ( (NULL == root) ||
+       (0 !=
+        json_array_append_new (ctx->mlist,
+                               root)) )
     goto fail;
   return;
 fail:

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



reply via email to

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