mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
Fix leak in qemuParseCommandLine on OOM
If the call to virDomainControllerInsert fails in qemuParseCommandLine, the controller struct is leaked. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
b391b19144
commit
94e6b94ab7
@ -11725,8 +11725,10 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
|
||||
ctldef->type = VIR_DOMAIN_CONTROLLER_TYPE_USB;
|
||||
ctldef->idx = 0;
|
||||
ctldef->model = -1;
|
||||
if (virDomainControllerInsert(def, ctldef) < 0)
|
||||
if (virDomainControllerInsert(def, ctldef) < 0) {
|
||||
VIR_FREE(ctldef);
|
||||
goto error;
|
||||
}
|
||||
} else if (STREQ(arg, "-pidfile")) {
|
||||
WANT_VALUE();
|
||||
if (pidfile)
|
||||
|
Loading…
x
Reference in New Issue
Block a user