From: Aki Tuomi Date: Fri, 11 Sep 2020 05:22:11 +0000 (+0300) Subject: lib-dict: dict - Keep track of next commit in dict_wait X-Git-Tag: 2.3.13~182 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f2ac2afaa0a53ce43baa138b25149f3011b121f;p=thirdparty%2Fdovecot%2Fcore.git lib-dict: dict - Keep track of next commit in dict_wait Satisfies static analyser, broken in 178bb676ea1dd380789d3587bf5e64fd85a29d7a --- diff --git a/src/lib-dict/dict.c b/src/lib-dict/dict.c index 1ed115151c..ed2b8a406a 100644 --- a/src/lib-dict/dict.c +++ b/src/lib-dict/dict.c @@ -165,11 +165,15 @@ void dict_deinit(struct dict **_dict) void dict_wait(struct dict *dict) { + struct dict_commit_callback_ctx *commit, *next; + e_debug(dict->event, "Waiting for dict to finish pending operations"); if (dict->v.wait != NULL) dict->v.wait(dict); - while (dict->commits != NULL) - dict_commit_async_timeout(dict->commits); + for (commit = dict->commits; commit != NULL; commit = next) { + next = commit->next; + dict_commit_async_timeout(commit); + } } bool dict_switch_ioloop(struct dict *dict)