dovecot-2.2: lib-storage: Don't leak memory if mailbox_save_set_...

dovecot at dovecot.org dovecot at dovecot.org
Tue May 13 13:46:39 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/8d1dcd28ee11
changeset: 17379:8d1dcd28ee11
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 13 15:46:01 2014 +0200
description:
lib-storage: Don't leak memory if mailbox_save_set_flags() is used multiple times for keywords.
This affected only some external plugins.

diffstat:

 src/lib-storage/mail-storage.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (13 lines):

diff -r 1aa94368ab28 -r 8d1dcd28ee11 src/lib-storage/mail-storage.c
--- a/src/lib-storage/mail-storage.c	Mon May 12 13:21:28 2014 +0300
+++ b/src/lib-storage/mail-storage.c	Tue May 13 15:46:01 2014 +0200
@@ -1930,6 +1930,9 @@
 {
 	struct mailbox *box = ctx->transaction->box;
 
+	if (ctx->data.keywords != NULL)
+		mailbox_keywords_unref(&ctx->data.keywords);
+
 	ctx->data.flags = flags & ~mailbox_get_private_flags_mask(box);
 	ctx->data.pvt_flags = flags & mailbox_get_private_flags_mask(box);
 	ctx->data.keywords = keywords;


More information about the dovecot-cvs mailing list