From: Stefan Metzmacher Date: Thu, 19 Nov 2009 08:38:48 +0000 (+0100) Subject: tdb: always set tdb->tracefd to -1 to be safe on goto fail X-Git-Tag: tdb-1.2.0~3 X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=commitdiff_plain;h=85449b7bcc4bd7948bea38b5514a02357950a002 tdb: always set tdb->tracefd to -1 to be safe on goto fail metze --- diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c index 64efafeb226..4ea4499dc14 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; }