[PATCH v2] virsh: Fix segfault of snapshot-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



'snaps' is used after free()'ed.
---
 tools/virsh-snapshot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
index 6dd8bf2..fc6c5b3 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);
             }
         }
-- 
1.7.7.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]