mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
virExecWithHook: avoid leak on OOM error path
* src/util/util.c (virExecWithHook): Free argv_str string before returning upon failure to allocate space for environment.
This commit is contained in:
parent
fd10c4e1ee
commit
6eed3feafb
@ -631,6 +631,7 @@ virExecWithHook(virConnectPtr conn,
|
|||||||
|
|
||||||
if (envp) {
|
if (envp) {
|
||||||
if ((envp_str = virArgvToString(envp)) == NULL) {
|
if ((envp_str = virArgvToString(envp)) == NULL) {
|
||||||
|
VIR_FREE(argv_str);
|
||||||
virReportOOMError(conn);
|
virReportOOMError(conn);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user