From: Timo Sirainen Date: Mon, 6 May 2013 17:20:43 +0000 (+0300) Subject: imap: URLFETCH leaked istream on failures. X-Git-Tag: 2.2.2~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b6cc2bca3b2fb58bbbea5293ed8f63d352dc305;p=thirdparty%2Fdovecot%2Fcore.git imap: URLFETCH leaked istream on failures. --- diff --git a/src/imap/cmd-urlfetch.c b/src/imap/cmd-urlfetch.c index d8c2e7f9df..92f17b92ba 100644 --- a/src/imap/cmd-urlfetch.c +++ b/src/imap/cmd-urlfetch.c @@ -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) {