[libvirt] [PATCH 4/6] uml: Plug memory leak on umlStartVMDaemon() error path

ajia at redhat.com ajia at redhat.com
Wed Nov 30 05:57:10 UTC 2011


From: Alex Jia <ajia at redhat.com>

Detected by Coverity.  Leak introduced in commit 8866eed.

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

diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 073f362..fe6d5ba 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -1051,6 +1051,7 @@ static int umlStartVMDaemon(virConnectPtr conn,
         VIR_FREE(vm->def->consoles[i]->info.alias);
         if (virAsprintf(&vm->def->consoles[i]->info.alias, "console%zu", i) < 0) {
             virReportOOMError();
+            VIR_FORCE_CLOSE(logfd);
             goto cleanup;
         }
     }
-- 
1.7.1




More information about the libvir-list mailing list