lib/param: clang: Fix Value stored is never read
authorNoel Power <noel.power@suse.com>
Wed, 3 Jul 2019 11:34:19 +0000 (11:34 +0000)
committerNoel Power <npower@samba.org>
Mon, 8 Jul 2019 09:30:09 +0000 (09:30 +0000)
Fixes:
lib/param/loadparm.c:2164:2: warning: Value stored to 'bRetval' is never read <--[clang]
        bRetval = false;
        ^         ~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
lib/param/loadparm.c

index 239d671803f2be1a495c81518e5adebf31d5f405..26b61789b3f01b573cca7b8b58a1ccab33b1f96e 100644 (file)
@@ -2161,15 +2161,14 @@ static bool do_section(const char *pszSectionName, void *userdata)
        isglobal = ((strwicmp(pszSectionName, GLOBAL_NAME) == 0) ||
                         (strwicmp(pszSectionName, GLOBAL_NAME2) == 0));
 
-       bRetval = false;
-
        /* if we've just struck a global section, note the fact. */
        lp_ctx->bInGlobalSection = isglobal;
 
        /* check for multiple global sections */
        if (lp_ctx->bInGlobalSection) {
                DEBUG(4, ("Processing section \"[%s]\"\n", pszSectionName));
-               return true;
+               bRetval = true;
+               goto out;
        }
 
        /* if we have a current service, tidy it up before moving on */
@@ -2188,10 +2187,11 @@ static bool do_section(const char *pszSectionName, void *userdata)
                                                                   pszSectionName))
                    == NULL) {
                        DEBUG(0, ("Failed to add a new service\n"));
-                       return false;
+                       bRetval = false;
+                       goto out;
                }
        }
-
+out:
        return bRetval;
 }