cedric pushed a commit to branch master.
commit ec67ea9c1e51f21e2e04535bfca9de95a05ca488
Author: Mariusz Grzegorczyk <[email protected]>
Date: Tue Sep 3 12:44:27 2013 +0900
ecore: fix segfault while adding new local or global data to thread.
---
src/lib/ecore/ecore_thread.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/lib/ecore/ecore_thread.c b/src/lib/ecore/ecore_thread.c
index 255aa21..ee13c45 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,
r = eina_hash_set(worker->hash, key, d);
CDB(worker->cond);
- ret = r->data;
- free(r);
- return ret;
+
+ if (r)
+ {
+ ret = r->data;
+ free(r);
+ return ret;
+ }
+ return NULL;
}
EAPI void *
@@ -1246,9 +1251,13 @@ ecore_thread_global_data_set(const char *key,
LRWKU(_ecore_thread_global_hash_lock);
CDB(_ecore_thread_global_hash_cond);
- ret = r->data;
- free(r);
- return ret;
+ if (r)
+ {
+ ret = r->data;
+ free(r);
+ return ret;
+ }
+ return NULL;
}
EAPI void *
--
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk