Fix memleak reported by Coverity and replace some XFree calls with

just free.

NB: Fixes Coverity CID1039275

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-08 12:39:48 +01:00
parent d7600cfbee
commit 0701304205
1 changed files with 7 additions and 4 deletions

View File

@ -268,13 +268,16 @@ ecore_x_dnd_type_set(Ecore_X_Window win,
{
if (ecore_x_dnd_type_isset(win, type))
{
XFree(old_data);
if (old_data) free(old_data);
return;
}
newset = calloc(num + 1, sizeof(Ecore_X_Atom));
if (!newset)
return;
{
if (old_data) free(old_data);
return;
}
data = (unsigned char *)newset;
@ -290,14 +293,14 @@ ecore_x_dnd_type_set(Ecore_X_Window win,
{
if (!ecore_x_dnd_type_isset(win, type))
{
XFree(old_data);
if (old_data) free(old_data);
return;
}
newset = calloc(num - 1, sizeof(Ecore_X_Atom));
if (!newset)
{
XFree(old_data);
if (old_data) free(old_data);
return;
}