]> xenbits.xensource.com Git - libvirt.git/commitdiff
virExecWithHook: avoid leak on OOM error path
authorJim Meyering <meyering@redhat.com>
Thu, 4 Feb 2010 11:25:34 +0000 (12:25 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 4 Feb 2010 19:00:07 +0000 (20:00 +0100)
* src/util/util.c (virExecWithHook): Free argv_str string before
returning upon failure to allocate space for environment.

src/util/util.c

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