From 7693f07feeebbb2109db19ac50c057aba442c3cc Mon Sep 17 00:00:00 2001 From: Julio Faracco Date: Thu, 25 May 2017 19:28:14 -0300 Subject: [PATCH] lxc: Fix wrong VIR_FREE after a return statement 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 --- src/lxc/lxc_container.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index a9363421f8..af02b54605 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -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); -- GitLab