TCP-group 1995
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: NOTICE-WARNING- TIME BOMB!!
- To: crompton@nadc.nadc.navy.mil
- Subject: Re: NOTICE-WARNING- TIME BOMB!!
- From: Phil Karn <karn@qualcomm.com>
- Date: Mon, 23 Jan 1995 20:44:28 -0800
- Cc: tcp-group@ucsd.edu, nos-bbs@hydra.carleton.ca
- In-reply-to: <9501231511.AA08762@nadc.nadc.navy.mil> (crompton@nadc.nadc.navy.mil)
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