It should be checked the return value for an error condition.
If it fails, realloc returns NULL. so if you use same value for return and param of realloc,
it is memory leak.
Change-Id: Iabdd913949fa30005cb56be6d824c2b7abb4ed2f
Evas_Object *o = NULL;
Eina_Rectangle *tr;
Eina_Iterator *ti;
- Eina_Rectangle *exr;
+ Eina_Rectangle *exr, *exr_new;
unsigned int i, tile_count;
#ifdef SHAPE_DEBUG
Eina_Rectangle *r;
exr[i++] = *(Eina_Rectangle*)((char*)tr);
if (i == tile_count - 1)
{
- exr = realloc(exr, sizeof(Eina_Rectangle) * (tile_count *= 2));
- EINA_SAFETY_ON_NULL_GOTO(exr, exr_fail);
+ exr_new = realloc(exr, sizeof(Eina_Rectangle) * (tile_count *= 2));
+ EINA_SAFETY_ON_NULL_GOTO(exr_new, exr_fail);
+ exr = exr_new;
}
#ifdef SHAPE_DEBUG
Eina_List *l;