From: Timo Sirainen Date: Thu, 19 Dec 2013 19:25:28 +0000 (+0200) Subject: pop3c: Memory leak fixes X-Git-Tag: 2.2.10~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cdb246858f37469fe61351dbc147dabbdde342c;p=thirdparty%2Fdovecot%2Fcore.git pop3c: Memory leak fixes --- diff --git a/src/lib-storage/index/pop3c/pop3c-client.c b/src/lib-storage/index/pop3c/pop3c-client.c index 26c6acf9df..6bfceaa78d 100644 --- a/src/lib-storage/index/pop3c/pop3c-client.c +++ b/src/lib-storage/index/pop3c/pop3c-client.c @@ -762,6 +762,7 @@ int pop3c_client_cmd_stream(struct pop3c_client *client, const char *cmd, client->dot_input = i_stream_create_seekable(inputs, POP3C_MAX_INBUF_SIZE, seekable_fd_callback, client); + i_stream_unref(&inputs[0]); i_assert(client->io == NULL); client->io = io_add(client->fd, IO_READ, diff --git a/src/lib-storage/index/pop3c/pop3c-storage.c b/src/lib-storage/index/pop3c/pop3c-storage.c index 65b321c2eb..f85236f121 100644 --- a/src/lib-storage/index/pop3c/pop3c-storage.c +++ b/src/lib-storage/index/pop3c/pop3c-storage.c @@ -185,7 +185,8 @@ static void pop3c_mailbox_close(struct mailbox *box) if (mbox->uidl_pool != NULL) pool_unref(&mbox->uidl_pool); - i_free(mbox->msg_sizes); + i_free_and_null(mbox->msg_uids); + i_free_and_null(mbox->msg_sizes); pop3c_client_deinit(&mbox->client); index_storage_mailbox_close(box); }