It seems that current clear_exceptional_node_lists() leaks memory used
for representing delayed and failed nodes.

Signed-off-by: Hitoshi Mitake <[email protected]>
---
 sheep/group.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index bb5d703..d335807 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -452,10 +452,14 @@ static void clear_exceptional_node_lists(void)
 {
        struct node *n, *t;
 
-       list_for_each_entry_safe(n, t, &sys->failed_nodes, list)
+       list_for_each_entry_safe(n, t, &sys->failed_nodes, list) {
                list_del(&n->list);
-       list_for_each_entry_safe(n, t, &sys->delayed_nodes, list)
+               free(n);
+       }
+       list_for_each_entry_safe(n, t, &sys->delayed_nodes, list) {
                list_del(&n->list);
+               free(n);
+       }
 }
 
 int epoch_log_read_remote(uint32_t epoch, struct sd_node *nodes, int len,
-- 
1.7.5.1

-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to