]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vbox: SnapshotConfAllChildren: reduce scope of tempSize
authorJán Tomko <jtomko@redhat.com>
Wed, 18 May 2022 13:59:16 +0000 (15:59 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 25 May 2022 13:10:02 +0000 (15:10 +0200)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/vbox/vbox_snapshot_conf.c

index 6b47893b5e18cfd43bc0a4c8a1a809ce87b32aa7..90afac179eb46a04783c11e1a040d7aa63391315 100644 (file)
@@ -454,7 +454,6 @@ virVBoxSnapshotConfAllChildren(virVBoxSnapshotConfHardDisk *disk,
                                virVBoxSnapshotConfHardDisk ***list)
 {
     size_t returnSize = 0;
-    size_t tempSize = 0;
     virVBoxSnapshotConfHardDisk **ret = NULL;
     virVBoxSnapshotConfHardDisk **tempList = NULL;
     size_t i = 0;
@@ -463,7 +462,7 @@ virVBoxSnapshotConfAllChildren(virVBoxSnapshotConfHardDisk *disk,
     ret = g_new0(virVBoxSnapshotConfHardDisk *, 0);
 
     for (i = 0; i < disk->nchildren; i++) {
-        tempSize = virVBoxSnapshotConfAllChildren(disk->children[i], &tempList);
+        size_t tempSize = virVBoxSnapshotConfAllChildren(disk->children[i], &tempList);
         VIR_EXPAND_N(ret, returnSize, tempSize);
 
         for (j = 0; j < tempSize; j++)