[libvirt] [PATCH 2/2] tests: Free @fakerootdir in error path

John Ferlan jferlan at redhat.com
Thu Jul 20 11:00:40 UTC 2017


Commit id 'dd9b29dad' added this new variable, but didn't free it in
one instance where status was returned to the caller.

Found by Coverity

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 tests/qemumemlocktest.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c
index 268563d..66ebabb 100644
--- a/tests/qemumemlocktest.c
+++ b/tests/qemumemlocktest.c
@@ -80,8 +80,10 @@ mymain(void)
     if (!abs_top_srcdir)
         abs_top_srcdir = abs_srcdir "/..";
 
-    if (qemuTestDriverInit(&driver) < 0)
+    if (qemuTestDriverInit(&driver) < 0) {
+        VIR_FREE(fakerootdir);
         return EXIT_FAILURE;
+    }
 
     driver.privileged = true;
 
-- 
2.9.4




More information about the libvir-list mailing list