summaryrefslogtreecommitdiff
path: root/src/lib/evas/cache2
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-07-04 15:13:20 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2013-07-08 16:06:08 +0900
commit8b257d02381f0fd5479353a339dc53f1a3887831 (patch)
tree2760675bbddad6b1983f8f64de2fbebcc4ad6277 /src/lib/evas/cache2
parentbb30cd58ce5e1e1ce171acf6ef51f530d31458ab (diff)
evas/cserve2: fix error parameter usage
The error pointer could be NULL but still dereferenced in case of failure. Also, it wasn't reset in case of success.
Diffstat (limited to 'src/lib/evas/cache2')
-rw-r--r--src/lib/evas/cache2/evas_cache2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/evas/cache2/evas_cache2.c b/src/lib/evas/cache2/evas_cache2.c
index fef11d24e7..81fd78c8d8 100644
--- a/src/lib/evas/cache2/evas_cache2.c
+++ b/src/lib/evas/cache2/evas_cache2.c
@@ -235,7 +235,8 @@ _evas_cache_image_entry_new(Evas_Cache2 *cache,
235 im = calloc(1, sizeof(RGBA_Image)); 235 im = calloc(1, sizeof(RGBA_Image));
236 if (!im) 236 if (!im)
237 { 237 {
238 *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; 238 if (error)
239 *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
239 return NULL; 240 return NULL;
240 } 241 }
241 242
@@ -264,12 +265,17 @@ _evas_cache_image_entry_new(Evas_Cache2 *cache,
264 ERR("couldn't load '%s' '%s' with cserve2!", 265 ERR("couldn't load '%s' '%s' with cserve2!",
265 ie->file, ie->key ? ie->key : ""); 266 ie->file, ie->key ? ie->key : "");
266 _evas_cache_image_entry_delete(cache, ie); 267 _evas_cache_image_entry_delete(cache, ie);
268 if (error)
269 *error = EVAS_LOAD_ERROR_GENERIC;
267 return NULL; 270 return NULL;
268 } 271 }
269 } 272 }
270 273
271 if (ie->cache_key) _evas_cache_image_activ_add(ie); 274 if (ie->cache_key) _evas_cache_image_activ_add(ie);
272 else _evas_cache_image_dirty_add(ie); 275 else _evas_cache_image_dirty_add(ie);
276
277 if (error)
278 *error = EVAS_LOAD_ERROR_NONE;
273 return ie; 279 return ie;
274} 280}
275 281