[libvirt] [PATCH] Fix a memory leak in the node_device_udev code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/node_device/node_device_udev.c |    7 -------
 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 3a5a7e2..bcfe991 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) {
-- 
1.6.6.1

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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]