forked from enlightenment/efl
eeze: remove memory leak
Summary: udev_enumerate_new needs to call udev_enumerate_unref before leaving. Reviewers: raster, Hermet, herb, jsuya Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12280
This commit is contained in:
parent
25aced168a
commit
66c5729494
|
@ -77,10 +77,15 @@ eeze_net_new(const char *name)
|
|||
syspath = eina_stringshare_add(name);
|
||||
break;
|
||||
}
|
||||
if (!device) return NULL;
|
||||
if (!device)
|
||||
{
|
||||
udev_enumerate_unref(en);
|
||||
return NULL;
|
||||
}
|
||||
net = calloc(1, sizeof(Eeze_Net));
|
||||
if (!net)
|
||||
{
|
||||
udev_enumerate_unref(en);
|
||||
udev_device_unref(device);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -91,6 +96,7 @@ eeze_net_new(const char *name)
|
|||
idx = udev_device_get_sysattr_value(net->device, "ifindex");
|
||||
if (!idx)
|
||||
{
|
||||
udev_enumerate_unref(en);
|
||||
udev_device_unref(net->device);
|
||||
eina_stringshare_del(net->syspath);
|
||||
eina_stringshare_del(net->name);
|
||||
|
|
|
@ -95,7 +95,11 @@ eeze_udev_find_unlisted_similar(Eina_List *list)
|
|||
return NULL;
|
||||
|
||||
device = _new_device(dev);
|
||||
if (!device) continue;
|
||||
if (!device)
|
||||
{
|
||||
udev_enumerate_unref(en);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((vendor = udev_device_get_property_value(device, "ID_VENDOR_ID")))
|
||||
udev_enumerate_add_match_property(en, "ID_VENDOR_ID", vendor);
|
||||
|
|
Loading…
Reference in New Issue