From: Liu Yuan <[email protected]>

Oops, after replying the patch, I found this memory leak bug.
-------------------------------------------------------- >8

We should also free prio_oids

Signed-off-by: Liu Yuan <[email protected]>
---
 sheep/recovery.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sheep/recovery.c b/sheep/recovery.c
index d3ce53c..9b715ea 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -403,10 +403,10 @@ static inline void finish_schedule_oids(struct 
recovery_work *rw)
        dprintf("nr_recovered %d, nr_prio_oids %d, count %d, new %d\n",
                nr_recovered, rw->nr_prio_oids, rw->count, new_idx);
 
-       free(rw->prio_oids);
        free(rw->oids);
        rw->oids = new_oids;
 done:
+       free(rw->prio_oids);
        rw->prio_oids = NULL;
        rw->nr_prio_oids = 0;
 }
-- 
1.7.10.2

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

Reply via email to