summaryrefslogtreecommitdiff
path: root/lib/tdb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tdb')
-rw-r--r--lib/tdb/common/open.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c
index 1ba2e7bd11..64efafeb22 100644
--- a/lib/tdb/common/open.c
+++ b/lib/tdb/common/open.c
@@ -403,8 +403,10 @@ int tdb_close(struct tdb_context *tdb)
tdb_munmap(tdb);
}
SAFE_FREE(tdb->name);
- if (tdb->fd != -1)
+ if (tdb->fd != -1) {
ret = close(tdb->fd);
+ tdb->fd = -1;
+ }
SAFE_FREE(tdb->lockrecs);
/* Remove from contexts list */