]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lxc: free 'ttyFDs' array on return from lxcVmStart
authorAlex Jia <ajia@redhat.com>
Wed, 9 Nov 2011 06:51:26 +0000 (14:51 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 9 Nov 2011 09:28:50 +0000 (10:28 +0100)
Detected by Coverity. Leak introduced in commit 0f31f7b.

* src/lxc/lxc_driver.c: Clean up on failure.

Signed-off-by: Alex Jia <ajia@redhat.com>
src/lxc/lxc_driver.c

index 37092bc9767bedd6bd604cfd4fe65ef2dfcac494..a1d0a7ce8fce4944bee00f614d265bfbee8fb15e 100644 (file)
@@ -1850,6 +1850,7 @@ cleanup:
     }
     for (i = 0 ; i < nttyFDs ; i++)
         VIR_FORCE_CLOSE(ttyFDs[i]);
+    VIR_FREE(ttyFDs);
     VIR_FORCE_CLOSE(handshakefds[0]);
     VIR_FORCE_CLOSE(handshakefds[1]);
     VIR_FREE(logfile);