Summary:
If realloc fails, lst would be NULL. So handling it.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Differential Revision: https://phab.enlightenment.org/D3182
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Ecore_X_ID item,
int op)
{
- Ecore_X_ID *lst;
+ Ecore_X_ID *lst, *temp;
int i, num;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
goto done; /* Add it */
num++;
+
+ temp = lst;
lst = realloc(lst, num * sizeof(Ecore_X_ID));
- lst[i] = item;
+ if (lst)
+ {
+ lst[i] = item;
+ }
+ else
+ {
+ lst = temp;
+ num--;
+ }
}
ecore_x_window_prop_xid_set(win, atom, type, lst, num);