]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: URLFETCH leaked istream on failures.
authorTimo Sirainen <tss@iki.fi>
Mon, 6 May 2013 17:20:43 +0000 (20:20 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 6 May 2013 17:20:43 +0000 (20:20 +0300)
src/imap/cmd-urlfetch.c

index d8c2e7f9df0c6ea67e93d2dde5b88311ea7af003..92f17b92ba21e92b4e48fb8a35a8ea8ab50fdf56 100644 (file)
@@ -39,6 +39,8 @@ static void cmd_urlfetch_finish(struct client_command_context *cmd)
                return;
        ctx->finished = TRUE;
 
+       if (ctx->input != NULL)
+               i_stream_unref(&ctx->input);
        if (ctx->ufetch != NULL)
                imap_urlauth_fetch_deinit(&ctx->ufetch);
 
@@ -225,7 +227,7 @@ static int cmd_urlfetch_url_sucess(struct client_command_context *cmd,
        if (reply->input != NULL) {
                ctx->input = reply->input;
                ctx->size = reply->size;
-               i_stream_ref(reply->input);
+               i_stream_ref(ctx->input);
 
                ret = cmd_urlfetch_transfer_literal(cmd);
                if (ret < 0) {