Fix memleak reported by Coverity and replace an XFree call

NB: Fixes Coverity CID1039276

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-08 12:41:00 +01:00
parent 0701304205
commit 45a2296218
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}