]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lxc: Fix wrong VIR_FREE after a return statement
authorJulio Faracco <jcfaracco@gmail.com>
Thu, 25 May 2017 22:28:14 +0000 (19:28 -0300)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 26 May 2017 09:38:18 +0000 (11:38 +0200)
There is a VIR_FREE after a return statement. That code section is never
executed and for this reason the "tty" variable is not being freed. This
commit rearranges the logic.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
src/lxc/lxc_container.c

index a9363421f8095f11d5c66b4b4126808781e8593b..af02b5460503bdf977325ae002f2c998e2b94e2f 100644 (file)
@@ -1143,8 +1143,8 @@ static int lxcContainerSetupDevices(char **ttyPaths, size_t nttyPaths)
             return -1;
 
         if (virFileBindMountDevice(ttyPaths[i], tty) < 0) {
-            return -1;
             VIR_FREE(tty);
+            return -1;
         }
 
         VIR_FREE(tty);