[Dovecot] quota_set leak

Timo Sirainen tss at iki.fi
Wed Jun 23 15:41:09 EEST 2010


On Tue, 2010-06-22 at 17:07 -0500, Mike Abbott wrote:
> The quota plugin in 2.0.beta6 leaks 2KB "quota settings" pools.  Here
> is a patch to plug this leak, assuming you intended the caller of
> quota_init to retain ownership of the quota_set.  If on the other hand
> you intended for quota_init to assume ownership of the quota_set, then
> the quota_settings_deinit call belongs in quota_deinit.

Yeah.. I guess quota-storage.c is better, although maybe cleanest would
be to have refcounts there, but since it's not really necessary it's too
much trouble. :)

> --- a/src/plugins/quota/quota-storage.c	(beta6)
> +++ b/src/plugins/quota/quota-storage.c	(patched)
> @@ -427,6 +427,7 @@
>  {
>  	struct quota_user *quser = QUOTA_USER_CONTEXT(user);
>  
> +	quota_settings_deinit(&quser->quota->set);
>  	quota_deinit(&quser->quota);
>  	quser->module_ctx.super.deinit(user);
>  }

Anyway, I don't think you should deinit quota settings before
quota_deinit() is finished. The quota root deinit()s might still want to
access the settings. http://hg.dovecot.org/dovecot-2.0/rev/37df22ecd572



More information about the dovecot mailing list