mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
@@ -631,6 +631,7 @@ virExecWithHook(virConnectPtr conn,
|
||||
|
||||
if (envp) {
|
||||
if ((envp_str = virArgvToString(envp)) == NULL) {
|
||||
VIR_FREE(argv_str);
|
||||
virReportOOMError(conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user