From 9c654ee7f8bd382ffa88c7716a77d0ad2b05bd8f Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Wed, 17 Feb 2021 10:18:28 +0900 Subject: [PATCH] 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 Change-Id: I6f2484184dd0b918952f7fbfddd3b974e8faba3b --- src/lib/eeze/eeze_udev_syspath.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/eeze/eeze_udev_syspath.c b/src/lib/eeze/eeze_udev_syspath.c index 4aca7fa..cc355e6 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) return NULL; if (!(parent = udev_device_get_parent(device))) - return NULL; + { + udev_device_unref(device); + return NULL; + } for (; parent; child = parent, parent = udev_device_get_parent(child)) { -- 2.7.4