]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3c: Memory leak fixes
authorTimo Sirainen <tss@iki.fi>
Thu, 19 Dec 2013 19:25:28 +0000 (21:25 +0200)
committerTimo Sirainen <tss@iki.fi>
Thu, 19 Dec 2013 19:25:28 +0000 (21:25 +0200)
src/lib-storage/index/pop3c/pop3c-client.c
src/lib-storage/index/pop3c/pop3c-storage.c

index 26c6acf9dfcd007e11bf94f25eecc3e6a5f5290d..6bfceaa78d52342c5605138c7513e8f45f62d8a6 100644 (file)
@@ -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,
index 65b321c2eb39206d8067300a22465924adca4581..f85236f121149e420edea5fcfc29e4e9362e4912 100644 (file)
@@ -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);
 }