summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source3/lib/dbwrap/dbwrap_watch.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/lib/dbwrap/dbwrap_watch.c b/source3/lib/dbwrap/dbwrap_watch.c
index 9ff8fc24b4..c0571d967c 100644
--- a/source3/lib/dbwrap/dbwrap_watch.c
+++ b/source3/lib/dbwrap/dbwrap_watch.c
@@ -30,11 +30,17 @@ static struct db_context *dbwrap_record_watchers_db(void)
static struct db_context *watchers_db;
if (watchers_db == NULL) {
+ char *db_path = lock_path("dbwrap_watchers.tdb");
+ if (db_path == NULL) {
+ return NULL;
+ }
+
watchers_db = db_open(
- NULL, lock_path("dbwrap_watchers.tdb"), 0,
+ NULL, db_path, 0,
TDB_CLEAR_IF_FIRST | TDB_INCOMPATIBLE_HASH,
O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_3,
DBWRAP_FLAG_NONE);
+ TALLOC_FREE(db_path);
}
return watchers_db;
}