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:
Shinwoo Kim 2021-05-24 19:48:43 +09:00 committed by Hermet Park
parent 25aced168a
commit 66c5729494
2 changed files with 12 additions and 2 deletions

View File

@ -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);

View File

@ -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);