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:
Jim Meyering 2010-02-04 12:25:34 +01:00
parent fd10c4e1ee
commit 6eed3feafb

View File

@ -631,6 +631,7 @@ virExecWithHook(virConnectPtr conn,
if (envp) {
if ((envp_str = virArgvToString(envp)) == NULL) {
VIR_FREE(argv_str);
virReportOOMError(conn);
return -1;
}