mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
qemu_snapshot: fix memory leak when reverting external snapshot
The code cleaning up virStorageSource doesn't free data allocated by
virStorageSourceInit() so we need to call virStorageSourceDeinit()
explicitly.
Fixes: 8e66473781
Resolves: https://issues.redhat.com/browse/RHEL-33044
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
38c6c36408
commit
2ea493598f
@ -2260,6 +2260,8 @@ qemuSnapshotRevertExternalFinish(virDomainObj *vm,
|
||||
snapdisk->src->path);
|
||||
}
|
||||
|
||||
virStorageSourceDeinit(snapdisk->src);
|
||||
|
||||
virDomainSnapshotDiskDefClear(snapdisk);
|
||||
}
|
||||
|
||||
@ -2277,6 +2279,8 @@ qemuSnapshotRevertExternalFinish(virDomainObj *vm,
|
||||
VIR_WARN("Failed to remove snapshot image '%s'",
|
||||
snapdisk->src->path);
|
||||
}
|
||||
|
||||
virStorageSourceDeinit(snapdisk->src);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user