mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-09 05:01:28 +00:00
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>
This commit is contained in:
parent
50250aba36
commit
18b3096c40
@ -815,13 +815,6 @@ static int udevProcessDisk(struct udev_device *device,
|
|||||||
union _virNodeDevCapData *data = &def->caps->data;
|
union _virNodeDevCapData *data = &def->caps->data;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
data->storage.drive_type = strdup("disk");
|
|
||||||
if (data->storage.drive_type == NULL) {
|
|
||||||
virReportOOMError();
|
|
||||||
ret = -1;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (udevGetUint64SysfsAttr(device,
|
if (udevGetUint64SysfsAttr(device,
|
||||||
"size",
|
"size",
|
||||||
&data->storage.num_blocks) == PROPERTY_ERROR) {
|
&data->storage.num_blocks) == PROPERTY_ERROR) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user