www.a00.de > tcpgroup > 1995 > msg00084
 

TCP-group 1995


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NOTICE-WARNING- TIME BOMB!!



> This reminds me...
> 
> One of the items on my list of things-to-do for my next release of NOS
> (yes! I really do plan such a thing!) is a set of macro wrappers for
> all functions that free pointer args.
> 
> For example, I'll create the following macro:
> 
> #define	FREE_P(x)	{free_p(x); x = NULL;}
> 
> and then replace all calls to the function free_p() with calls to the
> macro FREE_P().
> 
> The idea, of course, is to immediately nail any pointer that points to
> a freed object. I tried to do this "manually" in many places, but I'm
> sure I've missed many spots. This should make it much harder to get a
> "freeing garbage" message.
> 
> Why this has to be done in macros instead of as modifications to
> the function is left as an exercise for the beginning C student... :-)
> 
> Phil
> 

What we did was also poison the memory freed with 0x0d's so any deref
would cause a fault and a crash right away.




Document URL : http://www.a00.de/tcpgroup/1995/msg00084.php
Ralf D. Kloth, Ludwigsburg, DE (QRQ.software). < hostmaster at a00.de > [don't send spam]
Created 2005-01-02. Last modified 2005-01-02. Your visit 2020-10-30 23:03.07. Page created in 0.0586 sec.
 
[Go to the top of this page]   [... to the index page]