gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: fix more leaks


From: gnunet
Subject: [taler-merchant] branch master updated: fix more leaks
Date: Fri, 02 Apr 2021 14:36:21 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new fd1cac5c fix more leaks
fd1cac5c is described below

commit fd1cac5c4dd4dc121062a214e19bbd9585af943d
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Apr 2 14:36:19 2021 +0200

    fix more leaks
---
 src/backend/taler-merchant-httpd_post-tips-ID-pickup.c |  5 +++++
 src/lib/merchant_api_post_order_pay.c                  |  7 ++++---
 src/lib/merchant_api_tip_pickup.c                      |  4 ++++
 src/lib/merchant_api_tip_pickup2.c                     | 11 +++++++----
 src/testing/testing_api_cmd_get_reserve.c              |  3 +++
 src/testing/testing_api_cmd_merchant_get_tip.c         |  3 +++
 src/testing/testing_api_cmd_wallet_get_order.c         |  7 +++++++
 7 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_post-tips-ID-pickup.c 
b/src/backend/taler-merchant-httpd_post-tips-ID-pickup.c
index 5c695010..03da7262 100644
--- a/src/backend/taler-merchant-httpd_post-tips-ID-pickup.c
+++ b/src/backend/taler-merchant-httpd_post-tips-ID-pickup.c
@@ -223,6 +223,7 @@ stop_operations (struct PickupContext *pc)
     GNUNET_CONTAINER_DLL_remove (pc->po_head,
                                  pc->po_tail,
                                  po);
+    GNUNET_free (po);
   }
 }
 
@@ -287,6 +288,7 @@ withdraw_cb (void *cls,
                                po);
   if (NULL == blind_sig)
   {
+    GNUNET_free (po);
     stop_operations (pc);
     pc->http_status = MHD_HTTP_BAD_GATEWAY;
     pc->response =
@@ -304,6 +306,7 @@ withdraw_cb (void *cls,
                                               &pc->pickup_id,
                                               po->offset,
                                               blind_sig);
+  GNUNET_free (po);
   if (qs < 0)
   {
     stop_operations (pc);
@@ -354,6 +357,7 @@ do_withdraw (void *cls,
     GNUNET_CONTAINER_DLL_remove (pc->po_head,
                                  pc->po_tail,
                                  po);
+    GNUNET_free (po);
     pc->http_status = MHD_HTTP_GATEWAY_TIMEOUT;
     pc->response = TALER_MHD_make_json_pack (
       "{s:s, s:I}",
@@ -372,6 +376,7 @@ do_withdraw (void *cls,
     GNUNET_CONTAINER_DLL_remove (pc->po_head,
                                  pc->po_tail,
                                  po);
+    GNUNET_free (po);
     pc->http_status = MHD_HTTP_BAD_GATEWAY;
     pc->response =
       TALER_MHD_make_json_pack (
diff --git a/src/lib/merchant_api_post_order_pay.c 
b/src/lib/merchant_api_post_order_pay.c
index d6b081bd..eb9ecba1 100644
--- a/src/lib/merchant_api_post_order_pay.c
+++ b/src/lib/merchant_api_post_order_pay.c
@@ -517,9 +517,10 @@ TALER_MERCHANT_order_pay_frontend (
   }
   if (NULL != session_id)
   {
-    if (0 != json_object_set (pay_obj,
-                              "session_id",
-                              json_string (session_id)))
+    if (0 !=
+        json_object_set_new (pay_obj,
+                             "session_id",
+                             json_string (session_id)))
     {
       GNUNET_break (0);
       json_decref (pay_obj);
diff --git a/src/lib/merchant_api_tip_pickup.c 
b/src/lib/merchant_api_tip_pickup.c
index 2045cf0a..956e07ab 100644
--- a/src/lib/merchant_api_tip_pickup.c
+++ b/src/lib/merchant_api_tip_pickup.c
@@ -198,6 +198,8 @@ TALER_MERCHANT_tip_pickup (struct GNUNET_CURL_Context *ctx,
                                 &details[i]))
     {
       GNUNET_break (0);
+      for (unsigned int j = 0; j<i; j++)
+        GNUNET_free (details[j].coin_ev);
       GNUNET_array_grow (tp->planchets,
                          tp->num_planchets,
                          0);
@@ -220,6 +222,8 @@ TALER_MERCHANT_tip_pickup (struct GNUNET_CURL_Context *ctx,
                                          details,
                                          &pickup_done_cb,
                                          tp);
+  for (unsigned int j = 0; j<num_planchets; j++)
+    GNUNET_free (details[j].coin_ev);
   if (NULL == tp->tpo2)
   {
     GNUNET_break (0);
diff --git a/src/lib/merchant_api_tip_pickup2.c 
b/src/lib/merchant_api_tip_pickup2.c
index af57a584..9b6c4eff 100644
--- a/src/lib/merchant_api_tip_pickup2.c
+++ b/src/lib/merchant_api_tip_pickup2.c
@@ -258,10 +258,12 @@ TALER_MERCHANT_tip_pickup2 (struct GNUNET_CURL_Context 
*ctx,
                    " s:o," /* denom_pub_hash */
                    " s:o," /* coin_ev */
                    "}",
-                   "denom_pub_hash", GNUNET_JSON_from_data_auto (
+                   "denom_pub_hash",
+                   GNUNET_JSON_from_data_auto (
                      &planchet->denom_pub_hash),
-                   "coin_ev", GNUNET_JSON_from_data (planchet->coin_ev,
-                                                     planchet->coin_ev_size));
+                   "coin_ev",
+                   GNUNET_JSON_from_data (planchet->coin_ev,
+                                          planchet->coin_ev_size));
     if (NULL == p)
     {
       GNUNET_break (0);
@@ -278,7 +280,8 @@ TALER_MERCHANT_tip_pickup2 (struct GNUNET_CURL_Context *ctx,
     }
   }
   tp_obj = json_pack ("{s:o}",
-                      "planchets", pa);
+                      "planchets",
+                      pa);
   if (NULL == tp_obj)
   {
     GNUNET_break (0);
diff --git a/src/testing/testing_api_cmd_get_reserve.c 
b/src/testing/testing_api_cmd_get_reserve.c
index aa56c50c..ba03eb89 100644
--- a/src/testing/testing_api_cmd_get_reserve.c
+++ b/src/testing/testing_api_cmd_get_reserve.c
@@ -258,6 +258,9 @@ get_reserve_cleanup (void *cls,
                 "GET /private/reserve/$RESERVE_PUB operation did not 
complete\n");
     TALER_MERCHANT_reserve_get_cancel (grs->rgh);
   }
+  GNUNET_array_grow (grs->tips,
+                     grs->tips_length,
+                     0);
   GNUNET_free (grs);
 }
 
diff --git a/src/testing/testing_api_cmd_merchant_get_tip.c 
b/src/testing/testing_api_cmd_merchant_get_tip.c
index 5d0ba006..d2f0a1a5 100644
--- a/src/testing/testing_api_cmd_merchant_get_tip.c
+++ b/src/testing/testing_api_cmd_merchant_get_tip.c
@@ -304,6 +304,9 @@ merchant_get_tip_cleanup (void *cls,
     TALER_LOG_WARNING ("Get tip operation did not complete\n");
     TALER_MERCHANT_merchant_tip_get_cancel (tgs->tgh);
   }
+  GNUNET_array_grow (tgs->pickups,
+                     tgs->pickups_length,
+                     0);
   GNUNET_free (tgs);
 }
 
diff --git a/src/testing/testing_api_cmd_wallet_get_order.c 
b/src/testing/testing_api_cmd_wallet_get_order.c
index 446c702a..8b4700fd 100644
--- a/src/testing/testing_api_cmd_wallet_get_order.c
+++ b/src/testing/testing_api_cmd_wallet_get_order.c
@@ -175,13 +175,19 @@ wallet_get_order_cb (
           TALER_TESTING_get_trait_order_id (order_cmd,
                                             0,
                                             &order_id))
+      {
+        TALER_MERCHANT_parse_pay_uri_free (&pud);
         TALER_TESTING_FAIL (gos->is);
+      }
 
       if (GNUNET_OK !=
           TALER_TESTING_get_trait_claim_token (order_cmd,
                                                0,
                                                &claim_token))
+      {
+        TALER_MERCHANT_parse_pay_uri_free (&pud);
         TALER_TESTING_FAIL (gos->is);
+      }
 
       {
         char *port;
@@ -232,6 +238,7 @@ wallet_get_order_cb (
         TALER_MERCHANT_parse_pay_uri_free (&pud);
         return;
       }
+      TALER_MERCHANT_parse_pay_uri_free (&pud);
     }
     break;
   default:

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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