gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: fix leaks


From: gnunet
Subject: [taler-anastasis] branch master updated: fix leaks
Date: Sun, 14 Feb 2021 13:48:40 +0100

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

grothoff pushed a commit to branch master
in repository anastasis.

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

commit 13d70bb4c73f6fc067f2469e325532add87ce9b0
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Feb 14 13:48:37 2021 +0100

    fix leaks
---
 src/backend/anastasis-httpd_truth.c            | 28 +++++++++++++++++++-------
 src/restclient/anastasis_api_keyshare_lookup.c |  2 ++
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/src/backend/anastasis-httpd_truth.c 
b/src/backend/anastasis-httpd_truth.c
index 5cf426b..d241c3c 100644
--- a/src/backend/anastasis-httpd_truth.c
+++ b/src/backend/anastasis-httpd_truth.c
@@ -130,6 +130,11 @@ struct GetContext
    */
   bool in_list;
 
+  /**
+   * True if this entry is currently suspended.
+   */
+  bool suspended;
+
   /**
    * Did the request include a response?
    */
@@ -157,13 +162,14 @@ AH_truth_shutdown (void)
 
   while (NULL != (gc = gc_head))
   {
-    if (gc->in_list)
+    GNUNET_CONTAINER_DLL_remove (gc_head,
+                                 gc_tail,
+                                 gc);
+    gc->in_list = false;
+    if (gc->suspended)
     {
-      GNUNET_CONTAINER_DLL_remove (gc_head,
-                                   gc_tail,
-                                   gc);
-      gc->in_list = false;
       MHD_resume_connection (gc->connection);
+      gc->suspended = false;
     }
     if (NULL != gc->as)
     {
@@ -190,6 +196,7 @@ request_done (struct TM_HandlerContext *hc)
   if (NULL == gc)
     return;
   hc->cc = NULL;
+  GNUNET_assert (! gc->suspended);
   if (gc->in_list)
   {
     GNUNET_CONTAINER_DLL_remove (gc_head,
@@ -295,13 +302,15 @@ proposal_cb (void *cls,
   struct GetContext *gc = cls;
   enum GNUNET_DB_QueryStatus qs;
 
-  gc->hc->cc = NULL;
+  gc->po = NULL;
   GNUNET_assert (gc->in_list);
   GNUNET_CONTAINER_DLL_remove (gc_head,
                                gc_tail,
                                gc);
   gc->in_list = false;
+  GNUNET_assert (gc->suspended);
   MHD_resume_connection (gc->connection);
+  gc->suspended = false;
   AH_trigger_daemon (NULL);
   if (MHD_HTTP_OK != por->hr.http_status)
   {
@@ -358,13 +367,14 @@ check_payment_cb (void *cls,
   struct GetContext *gc = cls;
 
   gc->cpo = NULL;
-  gc->hc->cc = NULL;
   GNUNET_assert (gc->in_list);
   GNUNET_CONTAINER_DLL_remove (gc_head,
                                gc_tail,
                                gc);
   gc->in_list = false;
+  GNUNET_assert (gc->suspended);
   MHD_resume_connection (gc->connection);
+  gc->suspended = false;
   AH_trigger_daemon (NULL);
 
   switch (hr->http_status)
@@ -461,10 +471,13 @@ begin_payment (struct GetContext *gc)
                                        TALER_EC_GENERIC_DB_FETCH_FAILED,
                                        "lookup challenge payment");
   }
+  GNUNET_assert (! gc->in_list);
   gc->in_list = true;
   GNUNET_CONTAINER_DLL_insert (gc_tail,
                                gc_head,
                                gc);
+  GNUNET_assert (! gc->suspended);
+  gc->suspended = true;
   MHD_suspend_connection (gc->connection);
   order_id = GNUNET_STRINGS_data_to_string_alloc (
     &gc->payment_identifier,
@@ -1037,6 +1050,7 @@ AH_handler_truth_get (
                                        
TALER_EC_ANASTASIS_TRUTH_AUTHORIZATION_START_FAILED,
                                        NULL);
   }
+  GNUNET_assert (! gc->in_list);
   gc->in_list = true;
   GNUNET_CONTAINER_DLL_insert (gc_head,
                                gc_tail,
diff --git a/src/restclient/anastasis_api_keyshare_lookup.c 
b/src/restclient/anastasis_api_keyshare_lookup.c
index b46cbee..3868642 100644
--- a/src/restclient/anastasis_api_keyshare_lookup.c
+++ b/src/restclient/anastasis_api_keyshare_lookup.c
@@ -184,6 +184,7 @@ handle_keyshare_lookup_finished (void *cls,
       {
         GNUNET_break (0);
         kdd.status = ANASTASIS_KSD_SERVER_ERROR;
+        TALER_MERCHANT_parse_pay_uri_free (&pd);
         break;
       }
       kdd.status = ANASTASIS_KSD_PAYMENT_REQUIRED;
@@ -191,6 +192,7 @@ handle_keyshare_lookup_finished (void *cls,
       kslo->cb (kslo->cb_cls,
                 &kdd);
       ANASTASIS_keyshare_lookup_cancel (kslo);
+      TALER_MERCHANT_parse_pay_uri_free (&pd);
       return;
     }
     break;

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