Commit caa1c406 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

cr-show: avoid double free for pstree items

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent a6c5953a
...@@ -268,10 +268,8 @@ static int pstree_item_from_pb(PstreeEntry *e, struct pstree_item *item) ...@@ -268,10 +268,8 @@ static int pstree_item_from_pb(PstreeEntry *e, struct pstree_item *item)
item->pid.virt = e->pid; item->pid.virt = e->pid;
item->nr_threads = e->n_threads; item->nr_threads = e->n_threads;
item->threads = xzalloc(sizeof(struct pid) * e->n_threads); item->threads = xzalloc(sizeof(struct pid) * e->n_threads);
if (!item->threads) { if (!item->threads)
xfree(item);
return -1; return -1;
}
for (i = 0; i < item->nr_threads; i++) for (i = 0; i < item->nr_threads; i++)
item->threads[i].virt = e->threads[i]; item->threads[i].virt = e->threads[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment