From 45a2296218b0f29781265394f2a97aa1cd167fea Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 8 Jul 2013 12:41:00 +0100 Subject: [PATCH] Fix memleak reported by Coverity and replace an XFree call NB: Fixes Coverity CID1039276 Signed-off-by: Chris Michael --- 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 ca5217f1b3..f31f09d841 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; }