Re: Setting variable NULL after freeing it.

From: Willy Tarreau
Date: Sat Nov 12 2022 - 07:01:37 EST


On Sat, Nov 12, 2022 at 05:28:04PM +0530, A wrote:
> I was just thinking that when this is good practice (where its usage
> is genuine), then why is there not a kernel wide macro that would call
> kfree(x) and then set (x) = NULL. So, this will be done automatically
> for everyone and the developer will not have to decide whether to do
> this or not.

Very likely because developers want to decide.

Willy