summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorMariusz Grzegorczyk <mariusz.g@samsung.com>2013-09-03 12:44:27 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-09-03 12:44:27 +0900
commitec67ea9c1e51f21e2e04535bfca9de95a05ca488 (patch)
tree05ddfc23b317eff96095a4dd5e792074831991e5 /src/lib/ecore
parent9ac13e4aec83ea6dadfa62e4253b1db4ffe167e8 (diff)
ecore: fix segfault while adding new local or global data to thread.
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/ecore_thread.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/ecore/ecore_thread.c b/src/lib/ecore/ecore_thread.c
index 255aa21ce4..ee13c45043 100644
--- a/src/lib/ecore/ecore_thread.c
+++ b/src/lib/ecore/ecore_thread.c
@@ -1135,9 +1135,14 @@ ecore_thread_local_data_set(Ecore_Thread *thread,
1135 1135
1136 r = eina_hash_set(worker->hash, key, d); 1136 r = eina_hash_set(worker->hash, key, d);
1137 CDB(worker->cond); 1137 CDB(worker->cond);
1138 ret = r->data; 1138
1139 free(r); 1139 if (r)
1140 return ret; 1140 {
1141 ret = r->data;
1142 free(r);
1143 return ret;
1144 }
1145 return NULL;
1141} 1146}
1142 1147
1143EAPI void * 1148EAPI void *
@@ -1246,9 +1251,13 @@ ecore_thread_global_data_set(const char *key,
1246 LRWKU(_ecore_thread_global_hash_lock); 1251 LRWKU(_ecore_thread_global_hash_lock);
1247 CDB(_ecore_thread_global_hash_cond); 1252 CDB(_ecore_thread_global_hash_cond);
1248 1253
1249 ret = r->data; 1254 if (r)
1250 free(r); 1255 {
1251 return ret; 1256 ret = r->data;
1257 free(r);
1258 return ret;
1259 }
1260 return NULL;
1252} 1261}
1253 1262
1254EAPI void * 1263EAPI void *