]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dict: Avoid passing uninitialized pointer as function parameter
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 20 Oct 2023 09:21:25 +0000 (12:21 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 25 Oct 2023 09:20:48 +0000 (09:20 +0000)
It wasn't actually dereferencing the pointer, but it seems this was still
causing valgrind to sometimes log an error.

src/lib-dict/dict.c

index d327781344b7568f63a604da48a10e0dbc7deac2..fba9a4b6d3dd5a06031cec5fc6074e787abea328 100644 (file)
@@ -383,6 +383,8 @@ int dict_lookup_values(struct dict *dict, const struct dict_op_settings *set,
        int ret;
        i_assert(dict_key_prefix_is_valid(key, set->username));
 
+       *error_r = NULL;
+
        e_debug(event, "Looking up '%s'", key);
        event_add_str(event, "key", key);
        ret = dict->v.lookup(dict, set, pool, key, values_r, error_r);