diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2002-05-17 16:39:35 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2002-05-17 16:39:35 +0000 |
commit | 700f129750f9c5038f432a72ed290b4a205728e7 (patch) | |
tree | 6e213dae2c0630024235dd356f657b5c1915434a /src | |
parent | e4e78e0f1b061698c66e327a3fbdab8a14d98c53 (diff) |
Set the pointer to NULL after it's been freed()
Diffstat (limited to 'src')
-rw-r--r-- | src/utils.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils.h b/src/utils.h index f3861e2..c146cfd 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,4 +1,4 @@ -/* $Id: utils.h,v 1.16 2002-04-18 17:49:14 rjkaes Exp $ +/* $Id: utils.h,v 1.17 2002-05-17 16:39:35 rjkaes Exp $ * * See 'utils.h' for a detailed description. * @@ -69,13 +69,13 @@ extern char *debugging_strdup(const char* s, const char* file, # define safecalloc(x, y) debugging_calloc(x, y, __FILE__, __LINE__) # define safemalloc(x) debugging_malloc(x, __FILE__, __LINE__) # define saferealloc(x, y) debugging_realloc(x, y, __FILE__, __LINE__) -# define safefree(x) debugging_free(x, __FILE__, __LINE__) +# define safefree(x) debugging_free(x, __FILE__, __LINE__); (x) = NULL # define safestrdup(x) debugging_strdup(x, __FILE__, __LINE__) #else # define safecalloc(x, y) calloc(x, y) # define safemalloc(x) malloc(x) # define saferealloc(x, y) realloc(x, y) -# define safefree(x) free(x) +# define safefree(x) free(x); (x) = NULL # define safestrdup(x) strdup(x) #endif |