summaryrefslogtreecommitdiff
path: root/source3/tdb/tdb.h
diff options
context:
space:
mode:
Diffstat (limited to 'source3/tdb/tdb.h')
-rw-r--r--source3/tdb/tdb.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/tdb/tdb.h b/source3/tdb/tdb.h
index 6877e5cdf4..da8cca19de 100644
--- a/source3/tdb/tdb.h
+++ b/source3/tdb/tdb.h
@@ -134,6 +134,12 @@ void tdb_dump_all(TDB_CONTEXT *tdb);
void tdb_printfreelist(TDB_CONTEXT *tdb);
extern TDB_DATA tdb_null;
+
+/* 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
+
#ifdef __cplusplus
}
#endif