aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lalancette <clalance@redhat.com>2010-04-28 15:49:10 -0400
committerChris Lalancette <clalance@redhat.com>2010-04-29 09:15:54 -0400
commit18b3096c402270634ebc89bd28a1248ad77b925b (patch)
treefdfdb2f4dbdc5a02c7cd242e2f50ebf6265c9b74 /src/node_device/node_device_udev.c
parentFix build on Ubuntu. (diff)
downloadlibvirt-18b3096c402270634ebc89bd28a1248ad77b925b.tar.gz
libvirt-18b3096c402270634ebc89bd28a1248ad77b925b.tar.bz2
libvirt-18b3096c402270634ebc89bd28a1248ad77b925b.zip
Fix a memory leak in the node_device_udev code
We were over-writing a pointer without freeing it in case of a disk device, leading to a memory leak. Signed-off-by: Chris Lalancette <clalance@redhat.com>
Diffstat (limited to 'src/node_device/node_device_udev.c')
-rw-r--r--src/node_device/node_device_udev.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 3a5a7e2e4..bcfe991fb 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -815,13 +815,6 @@ static int udevProcessDisk(struct udev_device *device,
union _virNodeDevCapData *data = &def->caps->data;
int ret = 0;
- data->storage.drive_type = strdup("disk");
- if (data->storage.drive_type == NULL) {
- virReportOOMError();
- ret = -1;
- goto out;
- }
-
if (udevGetUint64SysfsAttr(device,
"size",
&data->storage.num_blocks) == PROPERTY_ERROR) {