summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/tdb/tdb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index 881d9b6ee5..b4ff0e1b01 100644
--- a/source3/tdb/tdb.c
+++ b/source3/tdb/tdb.c
@@ -1423,11 +1423,6 @@ TDB_CONTEXT *tdb_open_ex(char *name, int hash_size, int tdb_flags,
tdb->open_flags = open_flags;
tdb->log_fn = log_fn;
- if (!(tdb->name = (char *)strdup(name))) {
- errno = ENOMEM;
- goto fail;
- }
-
if ((open_flags & O_ACCMODE) == O_WRONLY) {
TDB_LOG((tdb, 0, "tdb_open_ex: can't open tdb %s write-only\n",
name));
@@ -1506,6 +1501,11 @@ TDB_CONTEXT *tdb_open_ex(char *name, int hash_size, int tdb_flags,
goto fail;
}
+ if (!(tdb->name = (char *)strdup(name))) {
+ errno = ENOMEM;
+ goto fail;
+ }
+
tdb->map_size = st.st_size;
tdb->device = st.st_dev;
tdb->inode = st.st_ino;