[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFERLOx9kwLDKFOd4e-FqNVSHA59v4A_Wk0Cv4EBp=aQSWMQyw@mail.gmail.com>
Date: Wed, 17 Jan 2018 16:14:41 +0530
From: Jose Bale <jb1987212@...il.com>
To: linux-kernel@...r.kernel.org
Subject: Hi (Assigning NULL to variable after freeing it).
Hi All,
I have just started to contribute to linux kernel. I was thinking of
giving a patch where a variable is made null after free if not already
done.
Some thing like this:
Original code:
kfree(x);
...........some other code...........
I will change this code to:
New code:
kfree(x);
++ x = NULL;
...........some other code...........
Will this kind of code change be accepted by linux kernel?
Also, isn't doing this a better practice - that is, assigning NULL to
variable after freeing it? What is the best practice? What do people
think about it?
Any feedback / replies will be greatly appreciated.
Regards,
JB
Powered by blists - more mailing lists