gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r36408 - gnunet/src/cadet


From: gnunet
Subject: [GNUnet-SVN] r36408 - gnunet/src/cadet
Date: Fri, 2 Oct 2015 05:37:32 +0200

Author: bartpolot
Date: 2015-10-02 05:37:32 +0200 (Fri, 02 Oct 2015)
New Revision: 36408

Modified:
   gnunet/src/cadet/cadet_path.c
   gnunet/src/cadet/gnunet-service-cadet_peer.c
Log:
- don't leave freed memory on the peer's path list, signal error and remove 
anyway

Modified: gnunet/src/cadet/cadet_path.c
===================================================================
--- gnunet/src/cadet/cadet_path.c       2015-10-02 03:37:31 UTC (rev 36407)
+++ gnunet/src/cadet/cadet_path.c       2015-10-02 03:37:32 UTC (rev 36408)
@@ -51,8 +51,15 @@
   path->path_delete = NULL;
 
   /* During shutdown, the peers peermap might not exist anymore. */
-  if (2 < path->length && (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) == 0)
+  if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) == 0)
   {
+    if (2 >= path->length)
+    {
+      /* This is not the place to destroy direct paths, only core_disconnect
+       * should do it and never delay it.
+       */
+      GNUNET_break (0);
+    }
     peer = GCP_get_short (path->peers[path->length - 1], GNUNET_NO);
     if (NULL != peer)
       GCP_remove_path (peer, path);

Modified: gnunet/src/cadet/gnunet-service-cadet_peer.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_peer.c        2015-10-02 03:37:31 UTC 
(rev 36407)
+++ gnunet/src/cadet/gnunet-service-cadet_peer.c        2015-10-02 03:37:32 UTC 
(rev 36408)
@@ -2214,7 +2214,7 @@
 
 
 /**
- * Remove any path to the peer that has the extact same peers as the one given.
+ * Remove any path to the peer that has the exact same peers as the one given.
  *
  * @param peer Peer to remove the path from.
  * @param path Path to remove. Is always destroyed .




reply via email to

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