summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-02-13 11:06:25 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-02-13 11:07:39 +0900
commit968751f8359ea3289d4137d6246b17b389bab49d (patch)
tree61fbb37166839a1fde467eb3a8f6b664dad1fdf8
parent38f1f9c5f243817c3db99e5584a447672163d6db (diff)
downloadefl-968751f8359ea3289d4137d6246b17b389bab49d.tar.gz
Evas: Free variable in error path
Fixes CID 1270032 Resource leaks (RESOURCE_LEAK) Variable "exim" going out of scope leaks the storage it points to.
-rw-r--r--src/modules/evas/engines/software_x11/evas_xlib_image.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/evas/engines/software_x11/evas_xlib_image.c b/src/modules/evas/engines/software_x11/evas_xlib_image.c
index 9514df450e..166f22a7bd 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_image.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_image.c
@@ -86,16 +86,17 @@ evas_xlib_image_native_set(void *data, void *image, void *native)
w = im->cache_entry.w;
h = im->cache_entry.h;
+ n = calloc(1, sizeof(Native));
+ if (!n) return NULL;
+
exim = ecore_x_image_new(w, h, vis, depth);
if (!exim)
{
ERR("ecore_x_image_new failed.");
+ free(n);
return NULL;
}
- n = calloc(1, sizeof(Native));
- if (!n) return NULL;
-
memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
n->pixmap = pm;
n->visual = vis;