gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r37789 - gnunet/src/consensus


From: gnunet
Subject: [GNUnet-SVN] r37789 - gnunet/src/consensus
Date: Fri, 26 Aug 2016 13:38:34 +0200

Author: grothoff
Date: 2016-08-26 13:38:34 +0200 (Fri, 26 Aug 2016)
New Revision: 37789

Modified:
   gnunet/src/consensus/gnunet-service-consensus.c
Log:
fix consensus memory leaks

Modified: gnunet/src/consensus/gnunet-service-consensus.c
===================================================================
--- gnunet/src/consensus/gnunet-service-consensus.c     2016-08-26 11:32:51 UTC 
(rev 37788)
+++ gnunet/src/consensus/gnunet-service-consensus.c     2016-08-26 11:38:34 UTC 
(rev 37789)
@@ -1758,7 +1758,10 @@
 
   iter = GNUNET_CONTAINER_multihashmap_iterator_create (rfn_in->rfn_elements);
 
-  while (GNUNET_YES == GNUNET_CONTAINER_multihashmap_iterator_next (iter, 
NULL, (const void **) &ri))
+  while (GNUNET_YES ==
+         GNUNET_CONTAINER_multihashmap_iterator_next (iter,
+                                                      NULL,
+                                                      (const void **) &ri))
   {
     uint16_t majority_num;
     enum ReferendumVote majority_vote;
@@ -1775,7 +1778,7 @@
         GNUNET_assert (GNUNET_OK ==
                        GNUNET_SET_add_element (set_out->h,
                                                ri->element,
-                                               set_mutation_done,
+                                               &set_mutation_done,
                                                progress_cls));
         GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                     "P%u: apply round: adding element %s with %u-majority.\n",
@@ -1787,7 +1790,7 @@
         GNUNET_assert (GNUNET_OK ==
                        GNUNET_SET_remove_element (set_out->h,
                                                   ri->element,
-                                                  set_mutation_done,
+                                                  &set_mutation_done,
                                                   progress_cls));
         GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                     "P%u: apply round: deleting element %s with 
%u-majority.\n",
@@ -1807,7 +1810,7 @@
     }
   }
 
-  if (progress_cls->num_pending == 0)
+  if (0 == progress_cls->num_pending)
   {
     // call closure right now, no pending ops
     GNUNET_free (progress_cls);
@@ -1858,7 +1861,7 @@
                   session->local_peer_idx);
     }
   }
-
+  GNUNET_CONTAINER_multihashmap_iterator_destroy (iter);
 }
 
 
@@ -1896,7 +1899,10 @@
 
   apply_diff_to_rfn (input_diff, output_rfn, task->key.leader, 
session->num_peers);
 
-  while (GNUNET_YES == GNUNET_CONTAINER_multihashmap_iterator_next (iter, 
NULL, (const void **) &ri))
+  while (GNUNET_YES ==
+         GNUNET_CONTAINER_multihashmap_iterator_next (iter,
+                                                      NULL,
+                                                      (const void **) &ri))
   {
     uint16_t majority_num;
     enum ReferendumVote majority_vote;
@@ -1922,6 +1928,7 @@
         break;
     }
   }
+  GNUNET_CONTAINER_multihashmap_iterator_destroy (iter);
 
   {
     uint16_t noncontested;
@@ -2158,7 +2165,7 @@
 
   GNUNET_CONTAINER_multihashmap_iterator_destroy (iter);
 
-  if (progress_cls->num_pending == 0)
+  if (0 == progress_cls->num_pending)
   {
     // call closure right now, no pending ops
     GNUNET_free (progress_cls);




reply via email to

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