devilhorns pushed a commit to branch master.
commit aea9e86eb47cc82d5973bd718c4c7b09a12a4e89
Author: Chris Michael <[email protected]>
Date: Mon Jul 8 12:12:48 2013 +0100
Fix several memleaks reported by Coverity
NB: Fixes Coverity CID1039268
Signed-off-by: Chris Michael <[email protected]>
---
src/lib/ecore_x/xlib/ecore_x_icccm.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/lib/ecore_x/xlib/ecore_x_icccm.c
b/src/lib/ecore_x/xlib/ecore_x_icccm.c
index 9902065..e8d34e5 100644
--- a/src/lib/ecore_x/xlib/ecore_x_icccm.c
+++ b/src/lib/ecore_x/xlib/ecore_x_icccm.c
@@ -975,7 +975,10 @@ ecore_x_icccm_colormap_window_set(Ecore_X_Window win,
{
newset = calloc(1, sizeof(Window));
if (!newset)
- return;
+ {
+ if (old_data) free(old_data);
+ return;
+ }
newset[0] = subwin;
num = 1;
@@ -986,7 +989,10 @@ ecore_x_icccm_colormap_window_set(Ecore_X_Window win,
newset = calloc(num + 1, sizeof(Window));
oldset = (Window *)old_data;
if (!newset)
- return;
+ {
+ if (old_data) free(old_data);
+ return;
+ }
for (i = 0; i < num; ++i)
{
@@ -1014,6 +1020,7 @@ ecore_x_icccm_colormap_window_set(Ecore_X_Window win,
ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
XA_WINDOW, 32, data, num);
free(newset);
+ free(old_data);
}
/**
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev