public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [DISCUSS] Make the variable NULL after freeing it.
@ 2006-12-21 23:41 Amit Choudhary
  2006-12-27 17:10 ` Pavel Machek
  0 siblings, 1 reply; 12+ messages in thread
From: Amit Choudhary @ 2006-12-21 23:41 UTC (permalink / raw)
  To: Linux Kernel

Hi,

Was just wondering if the _var_ in kfree(_var_) could be set to NULL after its freed. It may solve
the problem of accessing some freed memory as the kernel will crash since _var_ was set to NULL.

Does this make sense? If yes, then how about renaming kfree to something else and providing a
kfree macro that would do the following:

#define kfree(x) do { \
                      new_kfree(x); \
                      x = NULL; \
                    } while(0)

There might be other better ways too.

Regards,
Amit


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-01-01 21:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-21 23:41 [PATCH] [DISCUSS] Make the variable NULL after freeing it Amit Choudhary
2006-12-27 17:10 ` Pavel Machek
2006-12-28  8:54   ` Jan Engelhardt
2006-12-31 13:38     ` Bernd Petrovitsch
2007-01-01  0:43       ` Ingo Oeser
2007-01-01  1:05         ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-01  6:37         ` Amit Choudhary
2007-01-01 16:09           ` Ingo Oeser
2007-01-01 16:25             ` Andreas Schwab
2007-01-01 21:40               ` Ingo Oeser
2007-01-01 21:42                 ` Jan Engelhardt
2007-01-01 18:36             ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox