Blob Blame History Raw
From d6ecd69f63496446d23252426de41523ebe2bbf6 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@redhat.com>
Date: Mon, 29 Aug 2016 09:13:49 +0200
Subject: [PATCH 123/126] SYSDB: Fix uninitialized scalar variable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The boolean variable newly_created could be used uninitialized
in done section in case of failure. The variable was firstly initialized
to true after succesfull execution of function sysdb_cache_create_empty.

Uninitialized variable usually means true for boolean variable.

Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
---
 src/db/sysdb_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/db/sysdb_init.c b/src/db/sysdb_init.c
index c387c1b12c116f38d5a13f1adeac5ef64d593af8..d110aa7a2878e47650db177cfd342d0ac32248ab 100644
--- a/src/db/sysdb_init.c
+++ b/src/db/sysdb_init.c
@@ -545,7 +545,7 @@ static errno_t sysdb_cache_connect_helper(TALLOC_CTX *mem_ctx,
     const char *version = NULL;
     int ret;
     struct ldb_context *ldb;
-    bool newly_created;
+    bool newly_created = false;
 
     tmp_ctx = talloc_new(NULL);
     if (!tmp_ctx) {
-- 
2.4.11