[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



From: Alex Jia <ajia redhat com>

Detected by Coverity.  Leak introduced in commit 8866eed.

Signed-off-by: Alex Jia <ajia 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]