forked from enlightenment/efl
eeze_syspaty: fix a potention memory leak
Summary: if udev device get sysname fails, memory leaks. this patch fixes the problem. Change-Id: I2d02a6e6eb98e9262255ab3c02cf99f347b8c5f9 Reviewers: bu5hm4n, Hermet, zmike Reviewed By: Hermet Subscribers: vtorri, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12222
This commit is contained in:
parent
9a31278299
commit
b1c9b8cec0
|
@ -78,7 +78,10 @@ eeze_udev_syspath_get_devpath(const char *syspath)
|
|||
return NULL;
|
||||
|
||||
if (!(name = udev_device_get_devnode(device)))
|
||||
{
|
||||
udev_device_unref(device);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
name = eina_stringshare_add(name);
|
||||
udev_device_unref(device);
|
||||
|
@ -98,7 +101,10 @@ eeze_udev_syspath_get_devname(const char *syspath)
|
|||
return NULL;
|
||||
|
||||
if (!(name = udev_device_get_sysname(device)))
|
||||
{
|
||||
udev_device_unref(device);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
name = eina_stringshare_add(name);
|
||||
udev_device_unref(device);
|
||||
|
|
Loading…
Reference in New Issue