devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4b950b55c08d220d9b26d4a5a479d11ca4ea3e9b

commit 4b950b55c08d220d9b26d4a5a479d11ca4ea3e9b
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Mon Apr 13 20:29:53 2015 -0400

    efreetd: If we fail to allocate space for subdir_cache, then get out
    
    Summary: Fix coverity CID1294212 (potential Null pointer dereference) as
    the alloc for subdir_cache Could fail, however if it does we Were
    still trying to use it. In the case that it fails, ERR msg and return.
    
    @fix
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/bin/efreet/efreetd_cache.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/bin/efreet/efreetd_cache.c b/src/bin/efreet/efreetd_cache.c
index 8c6bab6..12f16cb 100644
--- a/src/bin/efreet/efreetd_cache.c
+++ b/src/bin/efreet/efreetd_cache.c
@@ -131,7 +131,12 @@ subdir_cache_init(void)
      }
    // if we don't have a decoded subdir cache - allocate one
    if (!subdir_cache) subdir_cache = calloc(1, sizeof(Subdir_Cache));
-   if (!subdir_cache) ERR("Cannot allocate subdir cache in memory");
+   if (!subdir_cache)
+     {
+        ERR("Cannot allocate subdir cache in memory");
+        return;
+     }
+
    // if we don't have a hash in the subdir cache - allocate it
    if (!subdir_cache->dirs)
      subdir_cache->dirs = 
eina_hash_string_superfast_new(EINA_FREE_CB(subdir_cache_dir_free));

-- 


Reply via email to