[libvirt] [PATCH] lxc: plug memory leak

ajia at redhat.com ajia at redhat.com
Wed Nov 9 06:51:26 UTC 2011


From: Alex Jia <ajia at redhat.com>

Detected by Coverity. Leak introduced in commit 0f31f7b.

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

Signed-off-by: Alex Jia <ajia at redhat.com>
---
 src/lxc/lxc_driver.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 37092bc..a1d0a7c 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -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);
-- 
1.7.1




More information about the libvir-list mailing list