gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: -fix leaks


From: gnunet
Subject: [taler-exchange] branch master updated: -fix leaks
Date: Wed, 29 Jun 2022 14:06:39 +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 9902e88b -fix leaks
9902e88b is described below

commit 9902e88b2d9dceb948275cf17b7ff62002da6fe3
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Jun 29 14:06:37 2022 +0200

    -fix leaks
---
 src/exchange/taler-exchange-httpd_purses_create.c  | 13 ++++++++++++-
 src/exchange/taler-exchange-httpd_purses_deposit.c |  8 ++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/exchange/taler-exchange-httpd_purses_create.c 
b/src/exchange/taler-exchange-httpd_purses_create.c
index e227f239..ba827428 100644
--- a/src/exchange/taler-exchange-httpd_purses_create.c
+++ b/src/exchange/taler-exchange-httpd_purses_create.c
@@ -440,7 +440,6 @@ parse_coin (struct MHD_Connection *connection,
                                              coin,
                                              jcoin)))
     return iret;
-
   if (GNUNET_OK !=
       (iret = TEH_common_deposit_check_purse_deposit (
          connection,
@@ -594,6 +593,8 @@ TEH_handler_purses_create (
     if (GNUNET_OK != res)
     {
       GNUNET_JSON_parse_free (spec);
+      for (unsigned int i = 0; i<idx; i++)
+        TEH_common_deposit_free_coin (&pcc.coins[i]);
       GNUNET_free (pcc.coins);
       return (GNUNET_NO == res) ? MHD_YES : MHD_NO;
     }
@@ -624,6 +625,8 @@ TEH_handler_purses_create (
   {
     TALER_LOG_WARNING ("Invalid signature on /purses/$PID/create request\n");
     GNUNET_JSON_parse_free (spec);
+    for (unsigned int i = 0; i<pcc.num_coins; i++)
+      TEH_common_deposit_free_coin (&pcc.coins[i]);
     GNUNET_free (pcc.coins);
     return TALER_MHD_reply_with_error (connection,
                                        MHD_HTTP_FORBIDDEN,
@@ -640,6 +643,8 @@ TEH_handler_purses_create (
   {
     TALER_LOG_WARNING ("Invalid signature on /purses/$PID/create request\n");
     GNUNET_JSON_parse_free (spec);
+    for (unsigned int i = 0; i<pcc.num_coins; i++)
+      TEH_common_deposit_free_coin (&pcc.coins[i]);
     GNUNET_free (pcc.coins);
     return TALER_MHD_reply_with_error (connection,
                                        MHD_HTTP_FORBIDDEN,
@@ -653,6 +658,8 @@ TEH_handler_purses_create (
   {
     GNUNET_break (0);
     GNUNET_JSON_parse_free (spec);
+    for (unsigned int i = 0; i<pcc.num_coins; i++)
+      TEH_common_deposit_free_coin (&pcc.coins[i]);
     GNUNET_free (pcc.coins);
     return TALER_MHD_reply_with_error (connection,
                                        MHD_HTTP_INTERNAL_SERVER_ERROR,
@@ -673,6 +680,8 @@ TEH_handler_purses_create (
                                 &pcc))
     {
       GNUNET_JSON_parse_free (spec);
+      for (unsigned int i = 0; i<pcc.num_coins; i++)
+        TEH_common_deposit_free_coin (&pcc.coins[i]);
       GNUNET_free (pcc.coins);
       return mhd_ret;
     }
@@ -684,6 +693,8 @@ TEH_handler_purses_create (
 
     res = reply_create_success (connection,
                                 &pcc);
+    for (unsigned int i = 0; i<pcc.num_coins; i++)
+      TEH_common_deposit_free_coin (&pcc.coins[i]);
     GNUNET_free (pcc.coins);
     GNUNET_JSON_parse_free (spec);
     return res;
diff --git a/src/exchange/taler-exchange-httpd_purses_deposit.c 
b/src/exchange/taler-exchange-httpd_purses_deposit.c
index 87e2f568..059ff03e 100644
--- a/src/exchange/taler-exchange-httpd_purses_deposit.c
+++ b/src/exchange/taler-exchange-httpd_purses_deposit.c
@@ -415,6 +415,8 @@ TEH_handler_purses_deposit (
     if (GNUNET_OK != res)
     {
       GNUNET_JSON_parse_free (spec);
+      for (unsigned int i = 0; i<idx; i++)
+        TEH_common_deposit_free_coin (&pcc.coins[i]);
       GNUNET_free (pcc.coins);
       return (GNUNET_NO == res) ? MHD_YES : MHD_NO;
     }
@@ -425,6 +427,8 @@ TEH_handler_purses_deposit (
   {
     GNUNET_break (0);
     GNUNET_JSON_parse_free (spec);
+    for (unsigned int i = 0; i<pcc.num_coins; i++)
+      TEH_common_deposit_free_coin (&pcc.coins[i]);
     GNUNET_free (pcc.coins);
     return TALER_MHD_reply_with_error (connection,
                                        MHD_HTTP_INTERNAL_SERVER_ERROR,
@@ -445,6 +449,8 @@ TEH_handler_purses_deposit (
                                 &pcc))
     {
       GNUNET_JSON_parse_free (spec);
+      for (unsigned int i = 0; i<pcc.num_coins; i++)
+        TEH_common_deposit_free_coin (&pcc.coins[i]);
       GNUNET_free (pcc.coins);
       return mhd_ret;
     }
@@ -471,6 +477,8 @@ TEH_handler_purses_deposit (
 
     res = reply_deposit_success (connection,
                                  &pcc);
+    for (unsigned int i = 0; i<pcc.num_coins; i++)
+      TEH_common_deposit_free_coin (&pcc.coins[i]);
     GNUNET_free (pcc.coins);
     GNUNET_JSON_parse_free (spec);
     return res;

-- 
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]