mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
qemu: caps: Don't leak package name string in virQEMUCapsInitQMPMonitor
If the detected qemu version is below our required version 'package' would be leaked. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
f7550ecce8
commit
78ad4c559e
@ -4322,7 +4322,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
|
||||
{
|
||||
int ret = -1;
|
||||
int major, minor, micro;
|
||||
char *package = NULL;
|
||||
VIR_AUTOFREE(char *) package = NULL;
|
||||
|
||||
/* @mon is supposed to be locked by callee */
|
||||
|
||||
@ -4347,7 +4347,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
|
||||
}
|
||||
|
||||
qemuCaps->version = major * 1000000 + minor * 1000 + micro;
|
||||
qemuCaps->package = package;
|
||||
VIR_STEAL_PTR(qemuCaps->package, package);
|
||||
qemuCaps->usedQMP = true;
|
||||
|
||||
if (virQEMUCapsInitQMPArch(qemuCaps, mon) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user