summaryrefslogtreecommitdiff
path: root/src/bin/efreet/efreetd_cache.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-04-13 20:29:53 -0400
committerChris Michael <cp.michael@samsung.com>2015-04-13 20:29:53 -0400
commit4b950b55c08d220d9b26d4a5a479d11ca4ea3e9b (patch)
treef47a63ff772cabcebcf1b2b805667024a69199c6 /src/bin/efreet/efreetd_cache.c
parentae8afa2748b7219d8382965aab599c4be1510935 (diff)
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.michael@samsung.com>
Diffstat (limited to 'src/bin/efreet/efreetd_cache.c')
-rw-r--r--src/bin/efreet/efreetd_cache.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bin/efreet/efreetd_cache.c b/src/bin/efreet/efreetd_cache.c
index 8c6bab62a3..12f16cbe6f 100644
--- a/src/bin/efreet/efreetd_cache.c
+++ b/src/bin/efreet/efreetd_cache.c
@@ -131,7 +131,12 @@ subdir_cache_init(void)
131 } 131 }
132 // if we don't have a decoded subdir cache - allocate one 132 // if we don't have a decoded subdir cache - allocate one
133 if (!subdir_cache) subdir_cache = calloc(1, sizeof(Subdir_Cache)); 133 if (!subdir_cache) subdir_cache = calloc(1, sizeof(Subdir_Cache));
134 if (!subdir_cache) ERR("Cannot allocate subdir cache in memory"); 134 if (!subdir_cache)
135 {
136 ERR("Cannot allocate subdir cache in memory");
137 return;
138 }
139
135 // if we don't have a hash in the subdir cache - allocate it 140 // if we don't have a hash in the subdir cache - allocate it
136 if (!subdir_cache->dirs) 141 if (!subdir_cache->dirs)
137 subdir_cache->dirs = eina_hash_string_superfast_new(EINA_FREE_CB(subdir_cache_dir_free)); 142 subdir_cache->dirs = eina_hash_string_superfast_new(EINA_FREE_CB(subdir_cache_dir_free));