summaryrefslogtreecommitdiff
path: root/src/bin/efreet
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-13 18:48:31 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-16 15:56:02 +0900
commit53d6486ffaec1e16dbad72d663a4f16ef3ca53f3 (patch)
tree34ac4b39e608e9480f3c822bfbc19ff0786ec1ca /src/bin/efreet
parentfef4c2c29249f13bab8f2470160cbc0a874999a6 (diff)
efreet icon cache create bin - check realloc results and handle
@fix
Diffstat (limited to 'src/bin/efreet')
-rw-r--r--src/bin/efreet/efreet_icon_cache_create.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bin/efreet/efreet_icon_cache_create.c b/src/bin/efreet/efreet_icon_cache_create.c
index c8e732bf05..9cefc82dad 100644
--- a/src/bin/efreet/efreet_icon_cache_create.c
+++ b/src/bin/efreet/efreet_icon_cache_create.c
@@ -85,6 +85,7 @@ cache_fallback_scan_dir(Eina_Hash *icons, Eina_Hash *dirs, const char *dir)
85 char *name; 85 char *name;
86 char *ext; 86 char *ext;
87 unsigned int i; 87 unsigned int i;
88 void *p;
88 89
89 if (entry->type == EINA_FILE_DIR) 90 if (entry->type == EINA_FILE_DIR)
90 continue; 91 continue;
@@ -114,7 +115,13 @@ cache_fallback_scan_dir(Eina_Hash *icons, Eina_Hash *dirs, const char *dir)
114 if (i != icon->icons_count) 115 if (i != icon->icons_count)
115 continue; 116 continue;
116 117
117 icon->icons = realloc(icon->icons, sizeof (char *) * (icon->icons_count + 1)); 118 p = realloc(icon->icons, sizeof (char *) * (icon->icons_count + 1));
119 if (!p)
120 {
121 ERR("Out of memory");
122 exit(1);
123 }
124 icon->icons = p;
118 icon->icons[icon->icons_count] = eina_stringshare_add(entry->path); 125 icon->icons[icon->icons_count] = eina_stringshare_add(entry->path);
119 eina_array_push(strs, icon->icons[icon->icons_count++]); 126 eina_array_push(strs, icon->icons[icon->icons_count++]);
120 } 127 }