fix null deref again, this time with the power of spankies
SVN revision: 56105
This commit is contained in:
parent
cf7eca75f8
commit
1147f3a5ca
|
@ -66,18 +66,18 @@ _new_va(const char *name,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
Eina_Mempool_Backend *be;
|
Eina_Mempool_Backend *be;
|
||||||
Eina_Mempool *mp = NULL;
|
Eina_Mempool *mp;
|
||||||
|
|
||||||
Eina_Error err = EINA_ERROR_NOT_MEMPOOL_MODULE;
|
Eina_Error err = EINA_ERROR_NOT_MEMPOOL_MODULE;
|
||||||
|
|
||||||
eina_error_set(0);
|
eina_error_set(0);
|
||||||
be = eina_hash_find(_backends, name);
|
be = eina_hash_find(_backends, name);
|
||||||
if (!be)
|
if ((!be) || (!be->init))
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
|
||||||
err = EINA_ERROR_OUT_OF_MEMORY;
|
err = EINA_ERROR_OUT_OF_MEMORY;
|
||||||
mp = calloc(1, sizeof(Eina_Mempool));
|
mp = calloc(1, sizeof(Eina_Mempool));
|
||||||
if ((!mp) || (!mp->backend.init))
|
if (!mp)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
|
||||||
/* FIXME why backend is not a pointer? */
|
/* FIXME why backend is not a pointer? */
|
||||||
|
@ -88,7 +88,6 @@ _new_va(const char *name,
|
||||||
|
|
||||||
on_error:
|
on_error:
|
||||||
eina_error_set(err);
|
eina_error_set(err);
|
||||||
if (mp) free(mp);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue