summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-08-30 04:31:55 +0000
committerAndrew Tridgell <tridge@samba.org>1998-08-30 04:31:55 +0000
commita6c94d7eb1a446c6281326964797a1eaf7fc6c78 (patch)
treecbc339b5079f25887d168c5c84fbb2b91581b36c /source3/lib
parentc021867feea2a7a1bc29ec89d7625754220f0431 (diff)
downloadsamba-a6c94d7eb1a446c6281326964797a1eaf7fc6c78.tar.gz
samba-a6c94d7eb1a446c6281326964797a1eaf7fc6c78.tar.bz2
samba-a6c94d7eb1a446c6281326964797a1eaf7fc6c78.zip
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)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c11
1 files changed, 11 insertions, 0 deletions
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);
+}