summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/evas_gl_polygon.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-07-08 08:38:54 +0100
committerChris Michael <cp.michael@samsung.com>2013-07-08 08:38:54 +0100
commit1ea718c28385fbcb2c619f3bbfd301fe7d83e4b2 (patch)
tree6ee6adf2b04a27aa92ace987ace43af8f6b1932f /src/modules/evas/engines/gl_common/evas_gl_polygon.c
parenteabc1482f91acbe3a56b602a660038bc32cfeb33 (diff)
Fix memleak reported by Coverity.
NB: Fixes Coverity CID1039654 Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/modules/evas/engines/gl_common/evas_gl_polygon.c')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_polygon.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_polygon.c b/src/modules/evas/engines/gl_common/evas_gl_polygon.c
index 536d2fc..f143d4c 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_polygon.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_polygon.c
@@ -70,10 +70,16 @@ evas_gl_common_poly_point_add(Evas_GL_Polygon *poly, int x, int y)
70{ 70{
71 Evas_GL_Polygon_Point *pt; 71 Evas_GL_Polygon_Point *pt;
72 72
73 if (!poly) poly = calloc(1, sizeof(Evas_GL_Polygon));
74 if (!poly) return NULL;
75 pt = calloc(1, sizeof(Evas_GL_Polygon_Point)); 73 pt = calloc(1, sizeof(Evas_GL_Polygon_Point));
76 if (!pt) return NULL; 74 if (!pt) return NULL;
75
76 if (!poly) poly = calloc(1, sizeof(Evas_GL_Polygon));
77 if (!poly)
78 {
79 free(pt);
80 return NULL;
81 }
82
77 pt->x = x; 83 pt->x = x;
78 pt->y = y; 84 pt->y = y;
79 poly->points = eina_list_append(poly->points, pt); 85 poly->points = eina_list_append(poly->points, pt);