then return -1 to indicate failure. Add some missing parens in the
formatting.
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@65074
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
&bytes_after, &prop_ret) != Success)
return -1;
- if (type_ret != XA_CARDINAL || format_ret != 32)
+ if ((type_ret != XA_CARDINAL) || (format_ret != 32))
num = -1;
- else if (num_ret == 0 || !prop_ret)
+ else if ((num_ret == 0) || (!prop_ret))
num = 0;
else
{
val = malloc(num_ret * sizeof(unsigned int));
+ if (!val)
+ {
+ if (prop_ret) XFree(prop_ret);
+ return -1;
+ }
for (i = 0; i < num_ret; i++)
val[i] = ((unsigned long *)prop_ret)[i];
num = num_ret;