summaryrefslogtreecommitdiffstats
path: root/source/tdb/tdb.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-01-09 18:26:39 +0000
committerJeremy Allison <jra@samba.org>2002-01-09 18:26:39 +0000
commit4f703b84cd7f258ae0169d52ca761b9404ccb348 (patch)
treebc845972e5d12ebe07a39242b4cd70491f278bb2 /source/tdb/tdb.c
parentbcb443c5c4bf97fe6b5b0993e42496c2e64f0124 (diff)
downloadsamba-4f703b84cd7f258ae0169d52ca761b9404ccb348.tar.gz
samba-4f703b84cd7f258ae0169d52ca761b9404ccb348.tar.xz
samba-4f703b84cd7f258ae0169d52ca761b9404ccb348.zip
Move SAFE_FREE into tdb.c to stop exporting it into tdb.h namespace.
Jeremy.
Diffstat (limited to 'source/tdb/tdb.c')
-rw-r--r--source/tdb/tdb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c
index fce5d5c943f..6398a2a166c 100644
--- a/source/tdb/tdb.c
+++ b/source/tdb/tdb.c
@@ -74,6 +74,11 @@
#define MAP_FAILED ((void *)-1)
#endif
+/* free memory if the pointer is valid and zero the pointer */
+#ifndef SAFE_FREE
+#define SAFE_FREE(x) do { if ((x) != NULL) {free((x)); (x)=NULL;} } while(0)
+#endif
+
#define BUCKET(hash) ((hash) % tdb->header.hash_size)
TDB_DATA tdb_null;