samdb: Fix build error with gcc8
authorAndreas Schneider <asn@samba.org>
Mon, 18 Jun 2018 08:24:06 +0000 (10:24 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 20 Jun 2018 20:22:07 +0000 (22:22 +0200)
../source4/dsdb/samdb/ldb_modules/samldb.c: In function ‘samldb_add’:
../source4/dsdb/samdb/ldb_modules/samldb.c:424:6: error: ‘found’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   if (found) {
      ^
../source4/dsdb/samdb/ldb_modules/samldb.c:348:11: note: ‘found’ was declared here
  bool ok, found;
           ^~~~~

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/dsdb/samdb/ldb_modules/samldb.c

index da11ee2180c7d17753b4091e977e8494e047e757..a7995e31cc189520ee2bf6eb0e539ea09f4fbe03 100644 (file)
@@ -345,7 +345,7 @@ static int samldb_generate_next_linkid(struct samldb_ctx *ac,
 static int samldb_schema_add_handle_linkid(struct samldb_ctx *ac)
 {
        int ret;
-       bool ok, found;
+       bool ok, found = false;
        struct ldb_message_element *el;
        const char *enc_str;
        const struct dsdb_attribute *attr;