From fdd501b773e6ef8529e44a8a6feb25e66143f1f0 Mon Sep 17 00:00:00 2001 From: Chinmaya Panigrahi Date: Thu, 11 Sep 2014 12:54:18 +0200 Subject: [PATCH] Evas: fix resource leak. Summary: Variable palpriv is going out of scope and leaks the storage it points to, if we do not free it before exiting. Test Plan: NA Reviewers: seoz, raster, cedric Subscribers: cedric, seoz Differential Revision: https://phab.enlightenment.org/D1429 Signed-off-by: Cedric BAIL --- src/modules/evas/engines/software_x11/evas_xlib_color.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/evas/engines/software_x11/evas_xlib_color.c b/src/modules/evas/engines/software_x11/evas_xlib_color.c index 55920e1a05..87e1453614 100644 --- a/src/modules/evas/engines/software_x11/evas_xlib_color.c +++ b/src/modules/evas/engines/software_x11/evas_xlib_color.c @@ -342,9 +342,10 @@ evas_software_xlib_x_color_allocate(Display *disp, palpriv->cmap = cmap; if (pal->colors == PAL_MODE_NONE) { - if (pal->lookup) free(pal->lookup); - free(pal); - return NULL; + if (pal->lookup) free(pal->lookup); + free(palpriv); + free(pal); + return NULL; } palettes = eina_list_append(palettes, pal); return pal;