From 3d12463644ca4c27d13319419c4ead0dd9e2d6f9 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Mon, 22 Oct 2012 22:28:59 +0800 Subject: [PATCH] virsh: Fix segfault of snapshot-list 'snaps' is used after free()'ed. (cherry picked from commit e0ad4669834d44763f7201ae97b997e9c64e8940) --- tools/virsh-snapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index b82837116e..53de2b3add 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -866,7 +866,7 @@ vshSnapshotListCollect(vshControl *ctl, virDomainPtr dom, goto cleanup; } if (from) { - snaps[snaplist->nsnaps++] = from; + snaplist->snaps[snaplist->nsnaps++].snap = from; virDomainSnapshotRef(from); } }