mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +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_str = virArgvToString(envp)) == NULL) {
|
||||
VIR_FREE(argv_str);
|
||||
virReportOOMError(conn);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user