devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=21c7f95d0829ff484f04e622c724fc1134bdcf21

commit 21c7f95d0829ff484f04e622c724fc1134bdcf21
Author: Chris Michael <[email protected]>
Date:   Tue Sep 17 09:23:46 2019 -0400

    efl_ui_caching_factory: Fix resource leaks
    
    Small patch to fix resource leaks pointed out by Coverity
    
    Fixes Coverity CID1404762
---
 src/lib/elementary/efl_ui_caching_factory.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/efl_ui_caching_factory.c 
b/src/lib/elementary/efl_ui_caching_factory.c
index 33a44a013d..245830f161 100644
--- a/src/lib/elementary/efl_ui_caching_factory.c
+++ b/src/lib/elementary/efl_ui_caching_factory.c
@@ -199,7 +199,11 @@ _efl_ui_caching_factory_efl_ui_factory_create(Eo *obj,
         r->factory = efl_ref(obj);
 
         all = calloc(1, sizeof (Eina_Future *));
-        if (!all) return efl_loop_future_rejected(obj, ENOMEM);
+        if (!all)
+          {
+             free(r);
+             return efl_loop_future_rejected(obj, ENOMEM);
+          }
 
         EINA_ITERATOR_FOREACH(models, model)
           {
@@ -209,7 +213,11 @@ _efl_ui_caching_factory_efl_ui_factory_create(Eo *obj,
                                             .data = r);
 
              all = realloc(all, (count + 1) * sizeof (Eina_Future *));
-             if (!all) return efl_loop_future_rejected(obj, ENOMEM);
+             if (!all)
+               {
+                  free(r);
+                  return efl_loop_future_rejected(obj, ENOMEM);
+               }
           }
         eina_iterator_free(models);
 

-- 


Reply via email to