Re: [PATCH] Correct two memory leaks triggered by udev events

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

 



On 05/28/10 - 11:13:29PM, Dave Allan wrote:
> diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
> index 6e3ecd7..5193f5b 100644
> --- a/src/node_device/node_device_udev.c
> +++ b/src/node_device/node_device_udev.c
> @@ -1211,6 +1211,8 @@ static int udevRemoveOneDevice(struct udev_device *device)
>      }
>      nodeDeviceUnlock(driverState);
> 
> +    udev_device_unref(device);
> +
>      return ret;
>  }

Instead of adding the udev_device_unref here and in in udevAddOneDevice, I
think we should probably just put it in the udevEventHandleCallback() and
udevProcessDeviceListEntry().  Besides the fact that it is easier to read and
verify that you've dropped the reference, if udev ever grows new actions
besides "add", "change", or "remove", we'll go back to leaking the reference.

--
Chris Lalancette

--
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]