devilhorns pushed a commit to branch master.
commit 45a2296218b0f29781265394f2a97aa1cd167fea
Author: Chris Michael <[email protected]>
Date: Mon Jul 8 12:41:00 2013 +0100
Fix memleak reported by Coverity and replace an XFree call
NB: Fixes Coverity CID1039276
Signed-off-by: Chris Michael <[email protected]>
---
src/lib/ecore_x/xlib/ecore_x_dnd.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/lib/ecore_x/xlib/ecore_x_dnd.c
b/src/lib/ecore_x/xlib/ecore_x_dnd.c
index ca5217f..f31f09d 100644
--- a/src/lib/ecore_x/xlib/ecore_x_dnd.c
+++ b/src/lib/ecore_x/xlib/ecore_x_dnd.c
@@ -228,7 +228,10 @@ ecore_x_dnd_type_isset(Ecore_X_Window win,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_XDND_TYPE_LIST,
XA_ATOM, 32, &data, &num))
- return ret;
+ {
+ if (data) free(data);
+ return ret;
+ }
atom = ecore_x_atom_get(type);
atoms = (Ecore_X_Atom *)data;
@@ -242,7 +245,7 @@ ecore_x_dnd_type_isset(Ecore_X_Window win,
}
}
- XFree(data);
+ if (data) free(data);
return ret;
}
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev