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 <cedric@osg.samsung.com>
This commit is contained in:
Chinmaya Panigrahi 2014-09-11 12:54:18 +02:00 committed by Cedric BAIL
parent 44cecb6a87
commit fdd501b773
1 changed files with 4 additions and 3 deletions

View File

@ -342,9 +342,10 @@ evas_software_xlib_x_color_allocate(Display *disp,
palpriv->cmap = cmap; palpriv->cmap = cmap;
if (pal->colors == PAL_MODE_NONE) if (pal->colors == PAL_MODE_NONE)
{ {
if (pal->lookup) free(pal->lookup); if (pal->lookup) free(pal->lookup);
free(pal); free(palpriv);
return NULL; free(pal);
return NULL;
} }
palettes = eina_list_append(palettes, pal); palettes = eina_list_append(palettes, pal);
return pal; return pal;