* include/am_utils.h (XFREE): XFREE() should nullify the pointer
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 7 Apr 2005 23:31:07 +0000 (23:31 +0000)
committerErez Zadok <ezk@cs.sunysb.edu>
Thu, 7 Apr 2005 23:31:07 +0000 (23:31 +0000)
even when compiling without debugging.  It's safer this way.

ChangeLog
include/am_utils.h

index d80cdab44dfbddc5c65839ab8c7dea32966464cb..36a15f309f1a8f4d7819c5c6d180e91d9c397515 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-04-07  Erez Zadok  <ezk@cs.sunysb.edu>
 
+       * include/am_utils.h (XFREE): XFREE() should nullify the pointer
+       even when compiling without debugging.  It's safer this way.
+
        * libamu/xutil.c (am_set_hostname),
        hlfsd/stubs.c (nfsproc_lookup_2_svc),
        fsinfo/fsinfo.c (fsi_get_args),
index c835fb653b3f0a468e2733b5242965a3a08cdbbf..3e8938b90fefc9a3d1d847c32a30cbad564b7b83 100644 (file)
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: am_utils.h,v 1.64 2005/04/07 03:50:41 ezk Exp $
+ * $Id: am_utils.h,v 1.65 2005/04/07 23:31:07 ezk Exp $
  *
  */
 
@@ -437,10 +437,10 @@ extern void dplog(const char *fmt, ...)
 #else /* not DEBUG */
 
 /*
- * if not debugging, then simple perform free, and don't bother
- * resetting the pointer.
+ * If not debugging, then also reset the pointer.
+ * It's safer -- and besides, free() should do that anyway.
  */
-#  define      XFREE(x) free(x)
+#  define      XFREE(x) do { free((voidp)x); x = NULL;} while (0)
 
 #define                amuDebug(x)     (0)