summaryrefslogtreecommitdiff
path: root/lib/tdb/common/open.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-11-19 09:38:48 +0100
committerStefan Metzmacher <metze@samba.org>2009-11-20 09:45:34 +0100
commit85449b7bcc4bd7948bea38b5514a02357950a002 (patch)
tree92ccf41db049de67a78e1a33d6748e0b526abdba /lib/tdb/common/open.c
parent92eff41ca52858124982b7db5e30c5321a16019d (diff)
downloadsamba-85449b7bcc4bd7948bea38b5514a02357950a002.tar.gz
samba-85449b7bcc4bd7948bea38b5514a02357950a002.tar.bz2
samba-85449b7bcc4bd7948bea38b5514a02357950a002.zip
tdb: always set tdb->tracefd to -1 to be safe on goto fail
metze
Diffstat (limited to 'lib/tdb/common/open.c')
-rw-r--r--lib/tdb/common/open.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c
index 64efafeb22..4ea4499dc1 100644
--- a/lib/tdb/common/open.c
+++ b/lib/tdb/common/open.c
@@ -163,6 +163,9 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
}
tdb_io_init(tdb);
tdb->fd = -1;
+#ifdef TDB_TRACE
+ tdb->tracefd = -1;
+#endif
tdb->name = NULL;
tdb->map_ptr = NULL;
tdb->flags = tdb_flags;
@@ -207,10 +210,6 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: tdb_new_database failed!"));
goto fail;
}
-#ifdef TDB_TRACE
- /* All tracing will fail. That's ok. */
- tdb->tracefd = -1;
-#endif
goto internal;
}