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 | 99782754f79f3795f81cbf57caeb0925f6a66c10 (patch) | |
tree | 41d57c4f68ee0bff248c19ef6ef85cfb817a132a /source | |
parent | d3dda65d5177154e2128f50ca3dd34e8e13b6b08 (diff) | |
download | samba-99782754f79f3795f81cbf57caeb0925f6a66c10.tar.gz |
added a function zero_free(void *, int size) that zeros an area of
memory then frees it. Useful for catching bugs.
Diffstat (limited to 'source')
-rw-r--r-- | source/lib/util.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index 414b54bd7c0..5b8428b546d 100644 --- a/source/lib/util.c +++ b/source/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); +} |