Fix memleak reported by Coverity: If we are going to error out when

getting window netwm types, then free any atoms returned by
prop_atom_list_get.

NB: Fixes Coverity CID1039265

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-08 11:44:23 +01:00
parent e28f298dbd
commit e6088e2361
1 changed files with 4 additions and 1 deletions

View File

@ -1237,7 +1237,10 @@ ecore_x_netwm_window_types_get(Ecore_X_Window win,
atoms2 = malloc(num * sizeof(Ecore_X_Window_Type));
if (!atoms2)
return 0;
{
if (atoms) free(atoms);
return 0;
}
for (i = 0; i < num; i++)
atoms2[i] = _ecore_x_netwm_window_type_type_get(atoms[i]);