[PATCH libXrandr 1/2] fix: doGetScreenResources() info: redundant null check on calling free()

Hans de Goede hdegoede at redhat.com
Mon Aug 15 06:58:19 UTC 2016


Hi,

On 12-08-16 16:09, walter harms wrote:
>
>
> Am 12.08.2016 12:11, schrieb Hans de Goede:
>> Hi,
>>
>> On 28-07-16 19:31, walter harms wrote:
>>>
>>> janitorial patch: remove some unneeded if() before free()
>>
>> This is not free() but Xfree() and "man Xfree" states:
>>
>> "A NULL pointer cannot be passed to this function."
>>
>
> this is wrong.
>
> Xfree is a define for free()
> Xlibint.h:#define Xfree(ptr) free((ptr))

I've pushed the 2 original patches now.

Note next time if you drop an if for a construct
like this:

     if (foo)
         Xfree(foo);

Then please also re-indent the Xfree and do not just
drop the if (as you've done in 2/2 this time). I've
fixed this up before pushing.

Regards,

Hans


More information about the xorg-devel mailing list