From: Timo Sirainen Date: Fri, 16 Aug 2024 07:36:33 +0000 (+0300) Subject: quota: Fix event/memory leak on invalid values for some quota settings X-Git-Tag: 2.4.0~1504 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=76f198a8161752c33e58910b2aebea89fa95cc10;p=thirdparty%2Fdovecot%2Fcore.git quota: Fix event/memory leak on invalid values for some quota settings --- diff --git a/src/plugins/quota/quota.c b/src/plugins/quota/quota.c index 49ba7c6f03..64fc9ccbc2 100644 --- a/src/plugins/quota/quota.c +++ b/src/plugins/quota/quota.c @@ -295,6 +295,8 @@ int quota_user_read_settings(struct mail_user *user, if (mailbox_count != NULL) { if (str_to_uint(mailbox_count, "a_set->max_mailbox_count) < 0) { *error_r = "Invalid quota_mailbox_count"; + event_unref("a_set->event); + pool_unref(&pool); return -1; } } @@ -307,6 +309,8 @@ int quota_user_read_settings(struct mail_user *user, &error) < 0) { *error_r = t_strdup_printf("quota_max_mail_size: %s", error); + event_unref("a_set->event); + pool_unref(&pool); return -1; } } @@ -317,6 +321,8 @@ int quota_user_read_settings(struct mail_user *user, if (str_to_uint(max_box_count, "a_set->max_messages_per_mailbox) < 0) { *error_r = "Invalid quota_mailbox_message_count"; + event_unref("a_set->event); + pool_unref(&pool); return -1; } }