gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] 01/02: fixing leaks


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 01/02: fixing leaks
Date: Sun, 22 Jan 2017 00:24:31 +0100

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

grothoff pushed a commit to branch master
in repository gnunet.

commit 03e9978c759523bcc682457f852514dd0b6f0857
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Jan 22 00:21:18 2017 +0100

    fixing leaks
---
 src/cadet/gnunet-service-cadet-new_tunnels.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/src/cadet/gnunet-service-cadet-new_tunnels.c 
b/src/cadet/gnunet-service-cadet-new_tunnels.c
index fee58fd17..111adffde 100644
--- a/src/cadet/gnunet-service-cadet-new_tunnels.c
+++ b/src/cadet/gnunet-service-cadet-new_tunnels.c
@@ -1490,7 +1490,7 @@ destroy_tunnel (void *cls)
 {
   struct CadetTunnel *t = cls;
   struct CadetTConnection *ct;
-  struct CadetTunnelQueueEntry *tqe;
+  struct CadetTunnelQueueEntry *tq;
 
   t->destroy_task = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1506,14 +1506,8 @@ destroy_tunnel (void *cls)
     GCC_destroy (ct->cc);
     GNUNET_free (ct);
   }
-  while (NULL != (tqe = t->tq_head))
-  {
-    GNUNET_CONTAINER_DLL_remove (t->tq_head,
-                                 t->tq_tail,
-                                 tqe);
-    GNUNET_MQ_discard (tqe->env);
-    GNUNET_free (tqe);
-  }
+  while (NULL != (tq = t->tq_head))
+    GCT_send_cancel (tq);
   GCP_drop_tunnel (t->destination,
                    t);
   GNUNET_CONTAINER_multihashmap32_destroy (t->channels);
@@ -1524,6 +1518,7 @@ destroy_tunnel (void *cls)
   }
   GNUNET_MST_destroy (t->mst);
   GNUNET_MQ_destroy (t->mq);
+  GNUNET_free_non_null (t->ax.DHRs);
   GNUNET_free (t);
 }
 
@@ -2352,17 +2347,18 @@ GCT_send (struct CadetTunnel *t,
  * function is called. Once the continuation is called, the message is
  * no longer in the queue!
  *
- * @param q Handle to the queue entry to cancel.
+ * @param tq Handle to the queue entry to cancel.
  */
 void
-GCT_send_cancel (struct CadetTunnelQueueEntry *q)
+GCT_send_cancel (struct CadetTunnelQueueEntry *tq)
 {
-  struct CadetTunnel *t = q->t;
+  struct CadetTunnel *t = tq->t;
 
   GNUNET_CONTAINER_DLL_remove (t->tq_head,
                                t->tq_tail,
-                               q);
-  GNUNET_free (q);
+                               tq);
+  GNUNET_MQ_discard (tq->env);
+  GNUNET_free (tq);
 }
 
 

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



reply via email to

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