Fix memleak of window_prop_property_get

NB: Fixes Coverity CID1039273

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-08 12:30:34 +01:00
parent e33391ef56
commit a01ce5e409
1 changed files with 6 additions and 1 deletions

View File

@ -1243,7 +1243,10 @@ ecore_x_e_window_profile_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_E_WINDOW_PROFILE,
XA_ATOM, 32, &data, &num))
return NULL;
{
if (data) free(data);
return NULL;
}
if (data)
atom = (Ecore_X_Atom *)data;
@ -1251,6 +1254,8 @@ ecore_x_e_window_profile_get(Ecore_X_Window win)
if (atom)
profile = ecore_x_atom_name_get(atom[0]);
if (data) free(data);
return profile;
}