memory leak in gpgme
Marcus Brinkmann
Marcus.Brinkmann at ruhr-uni-bochum.de
Sun Nov 11 19:57:01 CET 2001
On Fri, Nov 09, 2001 at 11:20:44AM +0100, Werner Koch wrote:
> > + if(arglist->data && arglist->data->type == GPGME_DATA_TYPE_CB)
> > + gpgme_data_release (arglist->data);
>
> Never try to access internal implementaion details of GpgmeData -
> actuallty it is a bug that the complete structure is in scope.
>
> Why do you want to release it anyway? I can't see that it is owned by
> arglist.
There are two cases where we need to release the data, either because it was
added by _gpgme_gpg_add_pm_data (this code is currently never reached
because of the assert), or because it is the command handler.
Only the latter is an issue right now, and it is only used for sign and
decrypt actions. It seems to me that it is sufficient for now to release
cmd.cb_data explicitely. In the general case, a flag in arg_and_data_s can
indicate the owner of the data.
I have committed a functionally equivalent change.
2001-11-11 Marcus Brinkmann <marcus at g10code.de>
* rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
Release all members of the list GPG->arglist.
Reported by Michael Schmidt <mschmidt at cs.uni-sb.de>.
Thanks,
Marcus
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd at debian.org
Marcus Brinkmann GNU http://www.gnu.org marcus at gnu.org
Marcus.Brinkmann at ruhr-uni-bochum.de
http://www.marcus-brinkmann.de
More information about the Gnupg-devel
mailing list