hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=37cecd54139ec8b7c81c71f5fb1c6c07a60815cb

commit 37cecd54139ec8b7c81c71f5fb1c6c07a60815cb
Author: Wonki Kim <wonki_....@samsung.com>
Date:   Thu Dec 24 11:43:28 2020 +0900

    eeze_net: fix a potentional memory leak case
    
    Summary:
    if `net` equals zero and `device` has allocated properly at the same time, 
memory leaks.
    this patch fixes it.
    
    Reviewers: Hermet, bu5hm4n, zmike
    
    Reviewed By: Hermet
    
    Subscribers: vtorri, cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D12221
---
 src/lib/eeze/eeze_net.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lib/eeze/eeze_net.c b/src/lib/eeze/eeze_net.c
index 47887d74b6..bdd7181993 100644
--- a/src/lib/eeze/eeze_net.c
+++ b/src/lib/eeze/eeze_net.c
@@ -78,7 +78,11 @@ eeze_net_new(const char *name)
      }
    if (!device) return NULL;
    net = calloc(1, sizeof(Eeze_Net));
-   if (!net) return NULL;
+   if (!net)
+     {
+        udev_device_unref(device);
+        return NULL;
+     }
    EINA_REFCOUNT_INIT(net);
    net->device = device;
    net->syspath = syspath;

-- 


Reply via email to