[PATCH:xkbcomp 1/4] Remove useless checks for NULL before free in OverlayKeyCreate()

Daniel Stone daniel at fooishbar.org
Mon Mar 10 23:01:34 PDT 2014


Hi,

On 11 March 2014 06:31, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> On Sat, Mar 08, 2014 at 07:10:25PM -0800, Alan Coopersmith wrote:
>> There is no need to ensure the pointers passed to free are not NULL,
>> especially right after passing them to strncpy without checking for
>> NULL.
>>
>> Flagged by cppcheck 1.64:
>> [app/xkbcomp/parseutils.c:557] -> [app/xkbcomp/parseutils.c:559]:
>>  (warning) Possible null pointer dereference: over - otherwise it
>>            is redundant to check it against null.
>> [app/xkbcomp/parseutils.c:558] -> [app/xkbcomp/parseutils.c:561]:
>>  (warning) Possible null pointer dereference: under - otherwise it
>>            is redundant to check it against null.
>>
>> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
>
> series: Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Ditto from me.

Cheers,
Daniel


More information about the xorg-devel mailing list