mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
tdb: always set tdb->tracefd to -1 to be safe on goto fail
metze
(cherry picked from samba commit 85449b7bcc
)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be ctdb commit 855391c1e37012b0d6c673a304bb8da8a1efcd72)
This commit is contained in:
parent
e0f59b0a19
commit
b768146ef5
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user