[libvirt] [PATCH] qemu: Fix memleak after commit 59898a88ce8431bd3ea249b8789edc2ef9985827

If the ABI compatibility check with the "migratable" user XML is successful, we would leak the originaly parsed XML from the user that would not be used in this case. Reported by Ján Tomko. --- src/qemu/qemu_driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 75348a1..0763f9b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5274,6 +5274,8 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, /* use the user provided XML */ newdef = def2; def2 = NULL; + } else { + virDomainDefFree(def2); } virDomainDefFree(def); -- 1.8.3.2

On 09/17/2013 11:12 AM, Peter Krempa wrote:
If the ABI compatibility check with the "migratable" user XML is successful, we would leak the originaly parsed XML from the user that
*originally
would not be used in this case.
Reported by Ján Tomko. --- src/qemu/qemu_driver.c | 2 ++ 1 file changed, 2 insertions(+)
ACK Jan

On 09/17/13 11:50, Ján Tomko wrote:
On 09/17/2013 11:12 AM, Peter Krempa wrote:
If the ABI compatibility check with the "migratable" user XML is successful, we would leak the originaly parsed XML from the user that
*originally
would not be used in this case.
Reported by Ján Tomko. --- src/qemu/qemu_driver.c | 2 ++ 1 file changed, 2 insertions(+)
ACK
Jan
Fixed && pushed; Thanks. Peter
participants (2)
-
Ján Tomko
-
Peter Krempa