]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-auth-client: auth-master - Introduce local variable for result in auth_lookup_rep...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 18 May 2020 21:25:20 +0000 (23:25 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 27 Aug 2025 14:17:02 +0000 (16:17 +0200)
src/lib-auth-client/auth-master.c

index 9f4f1a36135de7f37a366701b9e06909520986a1..28d1488e6e88121f4a6acfbfe61e855df89b4815 100644 (file)
@@ -863,6 +863,7 @@ auth_lookup_reply_callback(const struct auth_master_reply *reply,
        const char *value;
        const char *const *args = reply->args;
        unsigned int i, len;
+       int result;
 
        if (reply->errormsg != NULL) {
                lookup->fields = p_new(lookup->pool, const char *, 2);
@@ -875,11 +876,11 @@ auth_lookup_reply_callback(const struct auth_master_reply *reply,
        i_assert(reply->reply != NULL);
        i_assert(args != NULL);
 
-       lookup->return_value = parse_reply(lookup, reply->reply, args);
+       result = parse_reply(lookup, reply->reply, args);
 
        len = str_array_length(args);
        i_assert(*args != NULL || len == 0); /* for static analyzer */
-       if (lookup->return_value >= 0) {
+       if (result >= 0) {
                lookup->fields = p_new(lookup->pool, const char *, len + 1);
                for (i = 0; i < len; i++)
                        lookup->fields[i] = p_strdup(lookup->pool, args[i]);
@@ -910,6 +911,7 @@ auth_lookup_reply_callback(const struct auth_master_reply *reply,
                                lookup->expected_reply);
                }
        }
+       lookup->return_value = result;
        return 1;
 }