mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
Fix leak on OOM in qemuBuildCommandLine dealing with sound card
The qemuBuildCommandLine code for parsing sound cards will leak an intermediate variable if an OOM occurs. Move the free'ing of the variable earlier to avoid the leak. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
a72d25f40f
commit
86139a408d
@ -9102,7 +9102,7 @@ qemuBuildCommandLine(virConnectPtr conn,
|
||||
goto error;
|
||||
|
||||
virCommandAddArg(cmd, str);
|
||||
|
||||
VIR_FREE(str);
|
||||
if (sound->model == VIR_DOMAIN_SOUND_MODEL_ICH6 ||
|
||||
sound->model == VIR_DOMAIN_SOUND_MODEL_ICH9) {
|
||||
char *codecstr = NULL;
|
||||
@ -9130,8 +9130,6 @@ qemuBuildCommandLine(virConnectPtr conn,
|
||||
VIR_FREE(codecstr);
|
||||
}
|
||||
}
|
||||
|
||||
VIR_FREE(str);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user