diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2015-02-13 11:06:25 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2015-02-13 11:07:39 +0900 |
commit | 968751f8359ea3289d4137d6246b17b389bab49d (patch) | |
tree | 61fbb37166839a1fde467eb3a8f6b664dad1fdf8 | |
parent | 38f1f9c5f243817c3db99e5584a447672163d6db (diff) |
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.c | 7 |
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) | |||
86 | w = im->cache_entry.w; | 86 | w = im->cache_entry.w; |
87 | h = im->cache_entry.h; | 87 | h = im->cache_entry.h; |
88 | 88 | ||
89 | n = calloc(1, sizeof(Native)); | ||
90 | if (!n) return NULL; | ||
91 | |||
89 | exim = ecore_x_image_new(w, h, vis, depth); | 92 | exim = ecore_x_image_new(w, h, vis, depth); |
90 | if (!exim) | 93 | if (!exim) |
91 | { | 94 | { |
92 | ERR("ecore_x_image_new failed."); | 95 | ERR("ecore_x_image_new failed."); |
96 | free(n); | ||
93 | return NULL; | 97 | return NULL; |
94 | } | 98 | } |
95 | 99 | ||
96 | n = calloc(1, sizeof(Native)); | ||
97 | if (!n) return NULL; | ||
98 | |||
99 | memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); | 100 | memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); |
100 | n->pixmap = pm; | 101 | n->pixmap = pm; |
101 | n->visual = vis; | 102 | n->visual = vis; |