]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Fixed memory leak in SELECT QRESYNC error handling path.
authorTimo Sirainen <tss@iki.fi>
Thu, 20 Aug 2015 13:04:48 +0000 (16:04 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 20 Aug 2015 13:04:48 +0000 (16:04 +0300)
src/imap/cmd-select.c

index 04d61c0cf115bad84eb570c137e7bddd6a56c7ef..585c36cc7fe202de4508f60d37a4f76894e79c24 100644 (file)
@@ -238,6 +238,7 @@ static int select_qresync(struct imap_select_context *ctx)
        struct imap_fetch_context *fetch_ctx;
        struct mail_search_args *search_args;
        struct imap_fetch_qresync_args qresync_args;
+       int ret;
 
        search_args = mail_search_build_init();
        search_args->args = p_new(search_args->pool, struct mail_search_arg, 1);
@@ -273,10 +274,9 @@ static int select_qresync(struct imap_select_context *ctx)
                ctx->cmd->context = ctx;
                return 0;
        }
-       if (imap_fetch_end(fetch_ctx) < 0)
-               return -1;
+       ret = imap_fetch_end(fetch_ctx);
        imap_fetch_free(&fetch_ctx);
-       return 1;
+       return ret < 0 ? -1 : 1;
 }
 
 static int