Re: [PATCH] gdb: remove unnecessary NULL checks before xfree

Simon Marchi
2020-05-21T17:12:25Z

On 2020-05-21 11:23 a.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Simon> This patch removes the unnecessary NULL checks before calls to xfree.
> Simon> They are unnecessary because xfree already does a NULL check. Since
> Simon> free is supposed to handle NULL values correctly, the NULL check in
> Simon> xfree itself is also questionable, but I've left it there for now.
>
> Looks good. I think it's fine to remove the one from xfree as well.
>
> Note this same thing applies to delete. I don't know whether we have
> instances of that.

I've spotted some, but I won't change them as part of this patch, as I was focussing
on xfree.

Thanks to you and Pedro for reviewing, I'll push the patch.

Simon