s4:samdb: Fix building Samba with -O3
authorAndreas Schneider <asn@samba.org>
Wed, 9 Aug 2017 05:45:04 +0000 (07:45 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 9 Aug 2017 07:49:08 +0000 (09:49 +0200)
gcc error: â€˜result’ may be used uninitialized

This wont happen, because ldb will return and error, but the compiler
doesn't understand this.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/dsdb/samdb/ldb_modules/vlv_pagination.c

index 5b744e3c18177fe5f199b6a2da704ac2673b813e..980177cb05e030c738af47421db21898c0efcdc9 100644 (file)
@@ -436,7 +436,7 @@ static int vlv_results(struct vlv_context *ac)
                             ac->store->num_entries - 1);
 
                for (i = first_i; i <= last_i; i++) {
-                       struct ldb_result *result;
+                       struct ldb_result *result = NULL;
                        struct GUID *guid = &ac->store->results[i];
 
                        ret = vlv_search_by_dn_guid(ac->module, ac, &result, guid,