forked from enlightenment/efl
Ecore_X: If malloc fails (when trying to get a window property list),
then return -1 to indicate failure. Add some missing parens in the formatting. SVN revision: 65074
This commit is contained in:
parent
966067b4f3
commit
739751e6c3
|
@ -118,13 +118,18 @@ ecore_x_window_prop_card32_list_get(Ecore_X_Window win,
|
||||||
&bytes_after, &prop_ret) != Success)
|
&bytes_after, &prop_ret) != Success)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (type_ret != XA_CARDINAL || format_ret != 32)
|
if ((type_ret != XA_CARDINAL) || (format_ret != 32))
|
||||||
num = -1;
|
num = -1;
|
||||||
else if (num_ret == 0 || !prop_ret)
|
else if ((num_ret == 0) || (!prop_ret))
|
||||||
num = 0;
|
num = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
val = malloc(num_ret * sizeof(unsigned int));
|
val = malloc(num_ret * sizeof(unsigned int));
|
||||||
|
if (!val)
|
||||||
|
{
|
||||||
|
if (prop_ret) XFree(prop_ret);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
for (i = 0; i < num_ret; i++)
|
for (i = 0; i < num_ret; i++)
|
||||||
val[i] = ((unsigned long *)prop_ret)[i];
|
val[i] = ((unsigned long *)prop_ret)[i];
|
||||||
num = num_ret;
|
num = num_ret;
|
||||||
|
|
Loading…
Reference in New Issue