[CRIU] [PATCH 04/13] cr-show: avoid double free for pstree items

Andrey Vagin avagin at openvz.org
Wed Apr 3 13:31:03 EDT 2013


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-show.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/cr-show.c b/cr-show.c
index b8fc43a..2fc2ba1 100644
--- a/cr-show.c
+++ b/cr-show.c
@@ -268,10 +268,8 @@ static int pstree_item_from_pb(PstreeEntry *e, struct pstree_item *item)
 	item->pid.virt = e->pid;
 	item->nr_threads = e->n_threads;
 	item->threads = xzalloc(sizeof(struct pid) * e->n_threads);
-	if (!item->threads) {
-		xfree(item);
+	if (!item->threads)
 		return -1;
-	}
 
 	for (i = 0; i < item->nr_threads; i++)
 		item->threads[i].virt = e->threads[i];
-- 
1.7.11.7



More information about the CRIU mailing list