Mercurial > dovecot > core-2.2
changeset 19485:f979ca66a758
lmtp: Memory leak fixes on handling some RCPT TO failures.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 08 Dec 2015 10:17:10 +0200 |
parents | 46a35dcdb936 |
children | b4f2b8615da9 |
files | src/lmtp/commands.c |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lmtp/commands.c Mon Dec 07 21:09:47 2015 +0200 +++ b/src/lmtp/commands.c Tue Dec 08 10:17:10 2015 +0200 @@ -686,6 +686,7 @@ client_send_line(client, "451 4.3.0 <%s> " "Can't handle mixed proxy/non-proxy destinations", address); + mail_storage_service_user_free(&rcpt->service_user); return 0; } @@ -693,15 +694,16 @@ rcpt->address = p_strdup(client->state_pool, address); rcpt->detail = p_strdup(client->state_pool, detail); - if ((ret = lmtp_rcpt_to_is_over_quota(client, rcpt)) < 0) { - client_send_line(client, ERRSTR_TEMP_MAILBOX_FAIL, - rcpt->address); + if ((ret = lmtp_rcpt_to_is_over_quota(client, rcpt)) != 0) { + if (ret < 0) { + client_send_line(client, ERRSTR_TEMP_MAILBOX_FAIL, + rcpt->address); + } + mail_storage_service_user_free(&rcpt->service_user); return 0; } - if (ret == 0) { - array_append(&client->state.rcpt_to, &rcpt, 1); - client_send_line(client, "250 2.1.5 OK"); - } + array_append(&client->state.rcpt_to, &rcpt, 1); + client_send_line(client, "250 2.1.5 OK"); if (client->lmtp_set->lmtp_user_concurrency_limit > 0) { const char *query = t_strconcat("LOOKUP\t",