Fix memleak reported by Coverity.

NB: Fixes Coverity CID1039654

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-08 08:38:54 +01:00
parent eabc1482f9
commit 1ea718c283
1 changed files with 8 additions and 2 deletions

View File

@ -70,10 +70,16 @@ evas_gl_common_poly_point_add(Evas_GL_Polygon *poly, int x, int y)
{
Evas_GL_Polygon_Point *pt;
if (!poly) poly = calloc(1, sizeof(Evas_GL_Polygon));
if (!poly) return NULL;
pt = calloc(1, sizeof(Evas_GL_Polygon_Point));
if (!pt) return NULL;
if (!poly) poly = calloc(1, sizeof(Evas_GL_Polygon));
if (!poly)
{
free(pt);
return NULL;
}
pt->x = x;
pt->y = y;
poly->points = eina_list_append(poly->points, pt);