gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r30641 - gnunet/src/identity


From: gnunet
Subject: [GNUnet-SVN] r30641 - gnunet/src/identity
Date: Sat, 9 Nov 2013 18:23:30 +0100

Author: grothoff
Date: 2013-11-09 18:23:30 +0100 (Sat, 09 Nov 2013)
New Revision: 30641

Modified:
   gnunet/src/identity/identity_api.c
   gnunet/src/identity/test_identity_defaults.c
Log:
-fix potential leak and awkward test behavior causing it

Modified: gnunet/src/identity/identity_api.c
===================================================================
--- gnunet/src/identity/identity_api.c  2013-11-09 09:01:01 UTC (rev 30640)
+++ gnunet/src/identity/identity_api.c  2013-11-09 17:23:30 UTC (rev 30641)
@@ -952,13 +952,6 @@
   struct GNUNET_IDENTITY_Operation *op;
 
   GNUNET_assert (NULL != h);
-  while (NULL != (op = h->op_head))
-  {
-    GNUNET_CONTAINER_DLL_remove (h->op_head,
-                                h->op_tail,
-                                op);
-    GNUNET_free (op);
-  }
   if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
   {
     GNUNET_SCHEDULER_cancel (h->reconnect_task);
@@ -977,6 +970,14 @@
     GNUNET_CONTAINER_multihashmap_destroy (h->egos);
     h->egos = NULL;
   }
+  GNUNET_break (NULL == h->op_head);
+  while (NULL != (op = h->op_head))
+  {
+    GNUNET_CONTAINER_DLL_remove (h->op_head,
+                                h->op_tail,
+                                op);
+    GNUNET_free (op);
+  }
   if (NULL != h->client)
   {
     GNUNET_CLIENT_disconnect (h->client);

Modified: gnunet/src/identity/test_identity_defaults.c
===================================================================
--- gnunet/src/identity/test_identity_defaults.c        2013-11-09 09:01:01 UTC 
(rev 30640)
+++ gnunet/src/identity/test_identity_defaults.c        2013-11-09 17:23:30 UTC 
(rev 30641)
@@ -213,6 +213,8 @@
 {
   if (NULL == ego)
     return; /* skip first call */
+  if (NULL == identifier)
+    return; /* deletion / shutdown */
   op = GNUNET_IDENTITY_set (h,
                            "test-service",
                            ego,




reply via email to

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