diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-08-30 04:31:55 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-08-30 04:31:55 +0000 |
commit | a6c94d7eb1a446c6281326964797a1eaf7fc6c78 (patch) | |
tree | cbc339b5079f25887d168c5c84fbb2b91581b36c | |
parent | c021867feea2a7a1bc29ec89d7625754220f0431 (diff) | |
download | samba-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)
-rw-r--r-- | source3/lib/util.c | 11 |
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); +} |