From: Volker Lendecke Date: Mon, 22 Oct 2018 05:08:58 +0000 (+0200) Subject: tdb: Use explicit initialization X-Git-Tag: tdb-1.3.17~1216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c37bf2f93852780113ab882f14a099aeb204c458;p=thirdparty%2Fsamba.git tdb: Use explicit initialization Let the compiler figure out the optimal code Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider --- diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c index 44bb3a0009f..899a2fcaffb 100644 --- a/lib/tdb/common/open.c +++ b/lib/tdb/common/open.c @@ -297,7 +297,7 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td tdb_hash_func hash_fn) { int orig_errno = errno; - struct tdb_header header; + struct tdb_header header = {{0}}; struct tdb_context *tdb; struct stat st; int rev = 0; @@ -309,8 +309,6 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td uint32_t magic1, magic2; int ret; - ZERO_STRUCT(header); - if (!(tdb = (struct tdb_context *)calloc(1, sizeof *tdb))) { /* Can't log this */ errno = ENOMEM;