]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: auth-cache - Deduplicate auth_cache_parse_key() to use auth_cache_parse_key_and...
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 25 Jul 2025 08:48:43 +0000 (11:48 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 1 Aug 2025 08:18:11 +0000 (08:18 +0000)
Simplifies following commit

src/auth/auth-cache.c

index 3ccd45ff4b99cd3d0973357727c73d6a3a5b9ef5..ad8cbe50784ced29d352fdd2b0f77c89923bc61f 100644 (file)
@@ -122,14 +122,14 @@ static char *auth_cache_parse_key_exclude(pool_t pool, const char *query,
 
 char *auth_cache_parse_key(pool_t pool, const char *query)
 {
-       return auth_cache_parse_key_exclude(pool, query, NULL);
+       return auth_cache_parse_key_and_fields(pool, query, NULL, NULL);
 }
 
 char *auth_cache_parse_key_and_fields(pool_t pool, const char *query,
                                      const ARRAY_TYPE(const_string) *fields,
                                      const char *exclude_driver)
 {
-       if (!array_is_empty(fields)) {
+       if (fields != NULL && !array_is_empty(fields)) {
                unsigned int i, count;
                const char *const *str = array_get(fields, &count);
                string_t *full_query = t_str_new(128);