gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] 01/04: address leaks.


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] 01/04: address leaks.
Date: Wed, 21 Mar 2018 17:18:04 +0100

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

marcello pushed a commit to branch master
in repository exchange.

commit 7d4d3b3e9de03f6888647ed61c4156d392fcc640
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Mar 21 14:24:57 2018 +0100

    address leaks.
---
 src/exchange-lib/testing_api_cmd_withdraw.c | 10 ++++++++--
 src/exchange-lib/testing_api_helpers.c      |  8 ++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/exchange-lib/testing_api_cmd_withdraw.c 
b/src/exchange-lib/testing_api_cmd_withdraw.c
index 07dad69..3584cbd 100644
--- a/src/exchange-lib/testing_api_cmd_withdraw.c
+++ b/src/exchange-lib/testing_api_cmd_withdraw.c
@@ -58,6 +58,11 @@ struct WithdrawState
   struct TALER_EXCHANGE_Handle *exchange;
 
   /**
+   * Exchange base URL.
+   */
+  char *exchange_url;
+
+  /**
    * Interpreter state (during command).
    */
   struct TALER_TESTING_Interpreter *is;
@@ -229,6 +234,7 @@ withdraw_cleanup (void *cls,
     GNUNET_CRYPTO_rsa_signature_free (ws->sig.rsa_signature);
     ws->sig.rsa_signature = NULL;
   }
+  GNUNET_free_non_null (ws->exchange_url);
   GNUNET_free (ws);
 }
 
@@ -274,6 +280,7 @@ withdraw_traits (void *cls,
     TALER_TESTING_interpreter_fail (ws->is);
     return GNUNET_SYSERR;  
   }
+  ws->exchange_url = MAH_path_to_url (ws->exchange, "/");
 
   struct TALER_TESTING_Trait traits[] = {
     TALER_TESTING_make_trait_coin_priv (0 /* only one coin */,
@@ -288,8 +295,7 @@ withdraw_traits (void *cls,
                                            reserve_priv),
     TALER_TESTING_make_trait_amount_obj (0,
                                          &ws->amount),
-    TALER_TESTING_make_trait_url (
-      0, MAH_path_to_url (ws->exchange, "/")),
+    TALER_TESTING_make_trait_url (0, ws->exchange_url),
 
     TALER_TESTING_trait_end ()
   };
diff --git a/src/exchange-lib/testing_api_helpers.c 
b/src/exchange-lib/testing_api_helpers.c
index 6880315..43c2353 100644
--- a/src/exchange-lib/testing_api_helpers.c
+++ b/src/exchange-lib/testing_api_helpers.c
@@ -174,6 +174,7 @@ TALER_TESTING_prepare_exchange (const char *config_filename,
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                "Failed to run `taler-auditor-sign`,"
                 " is your PATH correct?\n");
+    GNUNET_free (signed_keys_out);
     return GNUNET_NO;
   }
   GNUNET_OS_process_wait (proc);
@@ -192,6 +193,8 @@ TALER_TESTING_prepare_exchange (const char *config_filename,
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                "Failed to run `taler-exchange-dbinit`,"
                 " is your PATH correct?\n");
+
+    GNUNET_free (signed_keys_out);
     return GNUNET_NO;
   }
   if (GNUNET_SYSERR ==
@@ -201,6 +204,7 @@ TALER_TESTING_prepare_exchange (const char *config_filename,
   {
     GNUNET_break (0);
     GNUNET_OS_process_destroy (proc);
+    GNUNET_free (signed_keys_out);
     return GNUNET_SYSERR;
   }
   GNUNET_OS_process_destroy (proc);
@@ -209,6 +213,7 @@ TALER_TESTING_prepare_exchange (const char *config_filename,
   {
     fprintf (stderr,
              "Failed to setup database\n");
+    GNUNET_free (signed_keys_out);
     return GNUNET_NO;
   }
   if ( (type != GNUNET_OS_PROCESS_EXITED) ||
@@ -217,8 +222,11 @@ TALER_TESTING_prepare_exchange (const char 
*config_filename,
     fprintf (stderr,
              "Unexpected error running"
              " `taler-exchange-dbinit'!\n");
+    GNUNET_free (signed_keys_out);
     return GNUNET_SYSERR;
   }
+
+  GNUNET_free (signed_keys_out);
   return GNUNET_OK;
 }
 

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



reply via email to

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