elementary/photocam - [E-devel] [Patch] elm_photocam patch

a. Handled memory allocation failure in function grid_create inside source file src/lib/elm_photocam.c of package elementary.
b. Fixed Memory leak in functiongrid_create due to return without releasing memory allocated for variable g of type Grid *.

Signed-Off-By: RAJEEV RANJAN <rajeev.r@samsung.com>
Signed-Off-By: PRINCE KUMAR DUBEY <prince.dubey@samsung.com>
Signed-Off-By: ChunEon Park <hermet@hermet.pe.kr>



SVN revision: 65698
This commit is contained in:
RAJEEV RANJAN 2011-11-30 00:12:10 +00:00 committed by ChunEon Park
parent ba55a1b120
commit 3983da5dbf
1 changed files with 6 additions and 1 deletions

View File

@ -289,6 +289,7 @@ grid_create(Evas_Object *obj)
if (!wd) return NULL;
g = calloc(1, sizeof(Grid));
if (!g) return NULL;
g->zoom = grid_zoom_calc(wd->zoom);
g->tsize = wd->tsize;
@ -297,7 +298,11 @@ grid_create(Evas_Object *obj)
g->w = g->iw / g->zoom;
g->h = g->ih / g->zoom;
if (g->zoom >= 8) return NULL;
if (g->zoom >= 8)
{
free(g);
return NULL;
}
g->gw = (g->w + g->tsize - 1) / g->tsize;
g->gh = (g->h + g->tsize - 1) / g->tsize;
g->grid = calloc(1, sizeof(Grid_Item) * g->gw * g->gh);