From c6df77a2cb73037a51126c6ac8ae83b0f5e1de44 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 30 Jun 2021 16:12:07 +1200 Subject: [PATCH] Initialise err in hdb_create() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Ubuntu 20.04 with gcc version 9.3.0 during a strict Samba build with -Werror=maybe-uninitialized we get: ../../source4/heimdal/lib/hdb/hdb.c: In function ‘hdb_create’: ../../source4/heimdal/lib/hdb/hdb.c:831:13: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 831 | if (*db && ret == 0) | ~~~~^~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Andrew Bartlett --- lib/hdb/hdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hdb/hdb.c b/lib/hdb/hdb.c index 2d6cee744..bb9b34640 100644 --- a/lib/hdb/hdb.c +++ b/lib/hdb/hdb.c @@ -737,7 +737,7 @@ load_config(krb5_context context, HDB *db) krb5_error_code hdb_create(krb5_context context, HDB **db, const char *filename) { - krb5_error_code ret; + krb5_error_code ret = ENOTSUP; struct cb_s cb_ctx; *db = NULL;