eina freeq - fix possible seg with NULL freeq and pattern fill logic

this fixes handling of a NULL freeq handle - found by coverity.

fixes CID 1369021
This commit is contained in:
Carsten Haitzler 2017-02-07 22:41:07 +09:00
parent 50ab088f79
commit 34883a12e7
1 changed files with 2 additions and 1 deletions

View File

@ -363,7 +363,8 @@ eina_freeq_ptr_add(Eina_FreeQ *fq,
if (!ptr) return;
if (!free_func) free_func = free;
if (!fq->postponed && (size < _eina_freeq_fillpat_max) && (size > 0))
if ((((fq) && !fq->postponed) || (!fq)) &&
(size < _eina_freeq_fillpat_max) && (size > 0))
_eina_freeq_fill_do(ptr, size);
if (!fq || fq->bypass)