summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2015-10-20 12:27:01 -0700
committerCedric BAIL <cedric@osg.samsung.com>2015-10-20 14:01:15 -0700
commitf4bd830e22a0c720e27654bb1f405bbed7efc083 (patch)
treea0132dc4805b529381620ba52ec431e370509863
parenta3ff6aff618449255ca660e0fe7329c3668740bd (diff)
downloadefl-f4bd830e22a0c720e27654bb1f405bbed7efc083.tar.gz
ector: handling memory leak on error.
Summary: Memory leak was caused by using the USE macro. So move the macro before doing any allocation. Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com> Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3183 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_shape.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_shape.c b/src/lib/ector/cairo/ector_renderer_cairo_shape.c
index 0f9193ed5c..edee785558 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_shape.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo_shape.c
@@ -208,13 +208,14 @@ _ector_renderer_cairo_shape_ector_renderer_generic_base_draw(Eo *obj, Ector_Rend
{
double *dashinfo;
+ USE(obj, cairo_set_dash, EINA_FALSE);
+
dashinfo = (double *) malloc(2 * pd->shape->stroke.dash_length * sizeof(double));
for (i = 0; i < pd->shape->stroke.dash_length; i++)
{
dashinfo[i*2] = pd->shape->stroke.dash[i].length;
dashinfo[i*2 + 1] = pd->shape->stroke.dash[i].gap;
}
- USE(obj, cairo_set_dash, EINA_FALSE);
cairo_set_dash(pd->parent->cairo, dashinfo, pd->shape->stroke.dash_length * 2, 0);
free(dashinfo);
}