Codebase list libvirt / a3b98c9
Don't free an uninitalized pointer in update_driver_name() Closes: #565983 Thanks: Matthias Bolte Laurent LĂ©onard 14 years ago
2 changed file(s) with 37 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 From: Matthias Bolte <matthias.bolte@googlemail.com>
1 Date: Wed, 23 Dec 2009 21:18:04 +0000
2 Subject: [PATCH] Don't free an uninitalized pointer in update_driver_name()
3
4 This invalid free results in heap corruption. Some symptoms I saw
5 because of this were libvirtd crashing and virt-manager hanging
6 while trying to enumerate devices.
7
8 Closes: #565983
9 ---
10 src/node_device/node_device_driver.c | 4 ++--
11 1 files changed, 2 insertions(+), 2 deletions(-)
12
13 diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
14 index ecbac0f..fbadfca 100644
15 --- a/src/node_device/node_device_driver.c
16 +++ b/src/node_device/node_device_driver.c
17 @@ -78,7 +78,7 @@ static int update_driver_name(virConnectPtr conn,
18 virNodeDeviceObjPtr dev)
19 {
20 char *driver_link = NULL;
21 - char *devpath;
22 + char *devpath = NULL;
23 char *p;
24 int ret = -1;
25
26 @@ -114,7 +114,7 @@ static int update_driver_name(virConnectPtr conn,
27
28 cleanup:
29 VIR_FREE(driver_link);
30 - free(devpath);
31 + VIR_FREE(devpath);
32 return ret;
33 }
34 #else
35 --
66 0007-Implement-path-lookup-for-USB-by-vendor-product.patch
77 0008-qemu-Use-log-output-for-pty-assignment-if-info-chard.patch
88 0009-Fix-QEMU-driver-custom-domain-status-XML-extensions.patch
9 0010-Don-t-free-an-uninitalized-pointer-in-update_driver_.patch