From f441bedbd453c57a87ed281eb2dec759899fac75 Mon Sep 17 00:00:00 2001 Message-Id: From: Hongwei Bi Date: Tue, 18 Feb 2014 15:45:27 -0700 Subject: [PATCH] LXC: Free variable vroot in lxcDomainDetachDeviceHostdevUSBLive() https://bugzilla.redhat.com/show_bug.cgi?id=1045643 prereq of CVE-2013-6456 The variable vroot should be freed in label cleanup. (cherry picked from commit 46c9bce4c8b0f2222cc50587ac968ced06eb1eff) Signed-off-by: Jiri Denemark --- src/lxc/lxc_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index d37962d..cf7b62c 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -3878,7 +3878,7 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver, virDomainHostdevDefPtr def = NULL; int idx, ret = -1; char *dst = NULL; - char *vroot; + char *vroot = NULL; virUSBDevicePtr usb = NULL; if ((idx = virDomainHostdevFind(vm->def, @@ -3936,6 +3936,7 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver, cleanup: virUSBDeviceFree(usb); VIR_FREE(dst); + VIR_FREE(vroot); return ret; } -- 1.9.0