Re: [libvirt] [PATCH 2/2] lxc: fixing wrong VIR_FREE after a return statement.

2017-05-26 Thread Martin Kletzander

On Thu, May 25, 2017 at 07:28:14PM -0300, Julio Faracco wrote:

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 rearrange the logic.



Same here, ACK with slight change in $SUBJ, will push soon.

Thanks.


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 2/2] lxc: fixing wrong VIR_FREE after a return statement.

2017-05-25 Thread Julio Faracco
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 rearrange 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 a936342..af02b54 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);
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list