1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemublocktest: Don't leak 'disk' in testQemuImageCreateLoadDiskXML

The function returns only the source portion but forgot to free the disk
wrapper.

Fixes: 9696427ad67196
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Peter Krempa 2021-10-25 16:11:49 +02:00
parent 060f344c80
commit 8e3a7c6db9

@ -473,7 +473,7 @@ testQemuImageCreateLoadDiskXML(const char *name,
virDomainXMLOption *xmlopt) virDomainXMLOption *xmlopt)
{ {
virDomainDiskDef *disk = NULL; g_autoptr(virDomainDiskDef) disk = NULL;
g_autofree char *xmlpath = NULL; g_autofree char *xmlpath = NULL;
g_autofree char *xmlstr = NULL; g_autofree char *xmlstr = NULL;
@ -490,7 +490,7 @@ testQemuImageCreateLoadDiskXML(const char *name,
if (qemuDomainDeviceDiskDefPostParse(disk, 0) < 0) if (qemuDomainDeviceDiskDefPostParse(disk, 0) < 0)
return NULL; return NULL;
return disk->src; return g_steal_pointer(&disk->src);
} }