]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Free @fakerootdir in error path
authorJohn Ferlan <jferlan@redhat.com>
Thu, 20 Jul 2017 10:46:41 +0000 (06:46 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 20 Jul 2017 14:08:27 +0000 (10:08 -0400)
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

tests/qemumemlocktest.c

index 268563df4f567918922baec2c7fcab81668bfc78..66ebabb65e3b36b350fc73bbf39753a6d42f70ca 100644 (file)
@@ -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;