added a function zero_free(void *, int size) that zeros an area of
authorAndrew Tridgell <tridge@samba.org>
Sun, 30 Aug 1998 04:31:55 +0000 (04:31 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 30 Aug 1998 04:31:55 +0000 (04:31 +0000)
memory then frees it. Useful for catching bugs.

source/lib/util.c

index 414b54bd7c03f46182cdac6d4dd88bdf2ba8d0ba..5b8428b546d5e7209afe42f9af67f451c89154e5 100644 (file)
@@ -5148,3 +5148,14 @@ int str_checksum(char *s)
        }
        return(res);
 } /* str_checksum */
+
+
+
+/*****************************************************************
+zero a memory area then free it. Used to catch bugs faster
+*****************************************************************/  
+void zero_free(void *p, int size)
+{
+       memset(p, 0, size);
+       free(p);
+}