mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemuSnapshotForEachQcow2: Don't initialize 'nrollback'
The variable holds the amount of disks to roll back the snapshot for. The value must be set before the code jumps to the 'rollback:' label so the best situation is to not initialize it and let the compiler catch errors rather than initialize the unsigned variable to -1 and let it crash. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
15cd4ec832
commit
d15eff6304
@ -290,7 +290,7 @@ qemuSnapshotForEachQcow2(virDomainDef *def,
|
||||
size_t i;
|
||||
bool skipped = false;
|
||||
bool create = STREQ(op, "-c");
|
||||
size_t nrollback = -1;
|
||||
size_t nrollback;
|
||||
virErrorPtr orig_err;
|
||||
|
||||
/* pre-checks */
|
||||
|
Loading…
Reference in New Issue
Block a user