gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated (6492d04 -> cc842f5)


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated (6492d04 -> cc842f5)
Date: Wed, 21 Mar 2018 17:18:28 +0100

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

marcello pushed a change to branch master
in repository merchant.

    from 6492d04  gently terminate twister.
     new f668006  address leaks.
     new 1a6c7ca  address leaks.
     new cc842f5  still on leaks.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/lib/merchant_api_history.c      |  1 +
 src/lib/merchant_api_proposal.c     |  7 ++++++-
 src/lib/test_merchant_api_twisted.c |  5 +++++
 src/lib/testing_api_cmd_pay.c       | 18 +++++++++++++-----
 4 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/src/lib/merchant_api_history.c b/src/lib/merchant_api_history.c
index 3ca8a12..38a0867 100644
--- a/src/lib/merchant_api_history.c
+++ b/src/lib/merchant_api_history.c
@@ -109,6 +109,7 @@ history_raw_cb (void *cls,
             response_code,
             TALER_EC_INVALID_RESPONSE,
             json);
+    TALER_MERCHANT_history_cancel (ho);
     return;
   case MHD_HTTP_OK:
     ho->cb (ho->cb_cls,
diff --git a/src/lib/merchant_api_proposal.c b/src/lib/merchant_api_proposal.c
index a670f8b..72b44fa 100644
--- a/src/lib/merchant_api_proposal.c
+++ b/src/lib/merchant_api_proposal.c
@@ -141,6 +141,7 @@ handle_proposal_finished (void *cls,
             TALER_EC_INVALID_RESPONSE,
             json,
             order_id);
+    TALER_MERCHANT_proposal_cancel (po);
     return;
   case MHD_HTTP_OK:
     {
@@ -276,7 +277,7 @@ handle_proposal_lookup_finished (void *cls,
                                  &sig),
     GNUNET_JSON_spec_end()
   };
-
+  plo->job = NULL;
   if (MHD_HTTP_OK != response_code)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -290,6 +291,7 @@ handle_proposal_lookup_finished (void *cls,
              NULL,
              NULL,
              NULL);
+    TALER_MERCHANT_proposal_lookup_cancel (plo);
     return;
   }
 
@@ -307,6 +309,8 @@ handle_proposal_lookup_finished (void *cls,
              NULL,
              NULL,
              NULL);
+
+    TALER_MERCHANT_proposal_lookup_cancel (plo);
     return;
   }
 
@@ -322,6 +326,7 @@ handle_proposal_lookup_finished (void *cls,
              NULL,
              NULL,
              NULL);
+    TALER_MERCHANT_proposal_lookup_cancel (plo);
     return;
   }
 
diff --git a/src/lib/test_merchant_api_twisted.c 
b/src/lib/test_merchant_api_twisted.c
index 981ed38..216ac91 100644
--- a/src/lib/test_merchant_api_twisted.c
+++ b/src/lib/test_merchant_api_twisted.c
@@ -588,11 +588,16 @@ main (int argc,
         (PROXY_MERCHANT_CONFIG_FILE)))
       return 77;
 
+    /* Run the exchange and schedule 'run()' */
     ret = TALER_TESTING_setup_with_exchange (&run, NULL,
                                              CONFIG_FILE);
     purge_process (merchantd);
     purge_process (twisterexchanged);
     purge_process (twistermerchantd);
+    GNUNET_free (fakebank_url);
+    GNUNET_free (merchant_url);
+    GNUNET_free (twister_exchange_url);
+    GNUNET_free (twister_merchant_url);
 
     if (GNUNET_OK != ret)
       return 1;
diff --git a/src/lib/testing_api_cmd_pay.c b/src/lib/testing_api_cmd_pay.c
index 6e8229a..40f1483 100644
--- a/src/lib/testing_api_cmd_pay.c
+++ b/src/lib/testing_api_cmd_pay.c
@@ -93,6 +93,12 @@ struct PayState
    */
   struct TALER_MERCHANT_Pay *po;
 
+  /**
+   * JSON object of contract terms.  Needed here
+   * to be free'd when this command gets cleaned up.
+   */
+  json_t *ct;
+
 };
 
 
@@ -692,7 +698,6 @@ _pay_run (const char *merchant_url,
 {
   const struct TALER_TESTING_Command *proposal_cmd;
   const char *contract_terms;
-  json_t *ct;
   const char *order_id;
   struct GNUNET_TIME_Absolute refund_deadline;
   struct GNUNET_TIME_Absolute pay_deadline;
@@ -709,6 +714,7 @@ _pay_run (const char *merchant_url,
   char *cr;
   struct TALER_MerchantSignatureP *merchant_sig;
   struct TALER_MERCHANT_Pay *ret;
+  struct PayState *ps = is->commands[is->ip].cls;
 
   proposal_cmd = TALER_TESTING_interpreter_lookup_command
     (is, proposal_reference);
@@ -728,9 +734,9 @@ _pay_run (const char *merchant_url,
 
   json_error_t error;
   if (NULL ==
-     (ct = json_loads (contract_terms,
-                       JSON_COMPACT,
-                       &error)))
+     (ps->ct = json_loads (contract_terms,
+                           JSON_COMPACT,
+                           &error)))
   {
     GNUNET_break (0);
     return NULL;
@@ -757,7 +763,7 @@ _pay_run (const char *merchant_url,
     GNUNET_JSON_spec_end()
   };
   if (GNUNET_OK !=
-      GNUNET_JSON_parse (ct,
+      GNUNET_JSON_parse (ps->ct,
                          spec,
                          &error_name,
                          &error_line))
@@ -877,6 +883,8 @@ pay_cleanup (void *cls,
 {
   struct PayState *ps = cls;
 
+  if (NULL != ps->ct)
+    json_decref (ps->ct);
   if (NULL != ps->po)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,

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



reply via email to

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