Commit 89234ce6 authored by Chris Michael's avatar Chris Michael

eina: Fix null pointer derefernce

Coverity reports that eina_safepointer_get returns a NULL promise here
(checked 20 out of 21 times). As eina_safepointer_get can return NULL,
we should check the validity of 'promise' here before trying to
derefernce it later.

Fixes Coverity CID1356625

@fix
Signed-off-by: default avatarChris Michael <cp.michael@samsung.com>
parent a8918606
......@@ -601,6 +601,8 @@ eina_promise_all(Eina_Iterator* it)
eina_iterator_free(it);
promise = eina_safepointer_get((Eina_Safepointer*)(safe_promise = eina_promise_add()));
if (!promise) return NULL;
internal_it = promise->pointer_value = malloc(sizeof(_Eina_Promise_Iterator) +
sizeof(_Eina_Promise_Default_Owner*) * eina_array_count_get(promises));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment