cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f4bd830e22a0c720e27654bb1f405bbed7efc083
commit f4bd830e22a0c720e27654bb1f405bbed7efc083 Author: Srivardhan Hebbar <sri.heb...@samsung.com> Date: Tue Oct 20 12:27:01 2015 -0700 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.heb...@samsung.com> Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3183 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/lib/ector/cairo/ector_renderer_cairo_shape.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/ector/cairo/ector_renderer_cairo_shape.c b/src/lib/ector/cairo/ector_renderer_cairo_shape.c index 0f9193e..edee785 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); } --