summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2021-02-17 10:18:28 +0900
committerShinwoo Kim <cinoo.kim@samsung.com>2021-02-17 10:18:43 +0900
commitccf77acc2202ee3f4e649c7bb24116302b512508 (patch)
tree0a4d20e0a29aa65160820ab3c1ad154f713edaf0 /src
parent17137316eeb728a30c3c14e4b3a2f1cd8765bbfc (diff)
eeze: fix a potention memory leak
Summary: if udev device get parents fails, memory leaks. this patch fixes the problem. Reviewers: raster, Hermet, jsuya, herb, ali.alzyod, devilhorns Reviewed By: ali.alzyod, devilhorns Subscribers: ali.alzyod, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12249
Diffstat (limited to 'src')
-rw-r--r--src/lib/eeze/eeze_udev_syspath.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/eeze/eeze_udev_syspath.c b/src/lib/eeze/eeze_udev_syspath.c
index 87b2c0fa78..4d2a5c237a 100644
--- a/src/lib/eeze/eeze_udev_syspath.c
+++ b/src/lib/eeze/eeze_udev_syspath.c
@@ -53,7 +53,10 @@ eeze_udev_syspath_get_parents(const char *syspath)
53 return NULL; 53 return NULL;
54 54
55 if (!(parent = udev_device_get_parent(device))) 55 if (!(parent = udev_device_get_parent(device)))
56 return NULL; 56 {
57 udev_device_unref(device);
58 return NULL;
59 }
57 60
58 for (; parent; child = parent, parent = udev_device_get_parent(child)) 61 for (; parent; child = parent, parent = udev_device_get_parent(child))
59 { 62 {