summaryrefslogtreecommitdiff
path: root/source/tdb/tdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/tdb/tdb.c')
-rw-r--r--source/tdb/tdb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c
index c7b70aa1533..388f4f419fe 100644
--- a/source/tdb/tdb.c
+++ b/source/tdb/tdb.c
@@ -703,6 +703,13 @@ int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key)
tdb_off rec_ptr;
struct list_struct rec;
+ if (tdb == NULL) {
+#ifdef TDB_DEBUG
+ printf("tdb_exists() called with null context\n");
+#endif
+ return 0;
+ }
+
/* find which hash bucket it is in */
hash = tdb_hash(&key);