From a6c94d7eb1a446c6281326964797a1eaf7fc6c78 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Aug 1998 04:31:55 +0000 Subject: added a function zero_free(void *, int size) that zeros an area of memory then frees it. Useful for catching bugs. (This used to be commit 99782754f79f3795f81cbf57caeb0925f6a66c10) --- source3/lib/util.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/lib/util.c') diff --git a/source3/lib/util.c b/source3/lib/util.c index 414b54bd7c..5b8428b546 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -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); +} -- cgit