From: Jim Meyering Date: Thu, 4 Feb 2010 11:25:34 +0000 (+0100) Subject: virExecWithHook: avoid leak on OOM error path X-Git-Tag: v0.7.7~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6eed3feafbc5a677ec85e0bd8d5cfba60a5536bb;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/util/util.c b/src/util/util.c index 7e0cd508ce..a01fc45373 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -631,6 +631,7 @@ virExecWithHook(virConnectPtr conn, if (envp) { if ((envp_str = virArgvToString(envp)) == NULL) { + VIR_FREE(argv_str); virReportOOMError(conn); return -1; }