memory leak in gpgme

Marcus Brinkmann Marcus.Brinkmann at
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>

        * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
        Release all members of the list GPG->arglist.
        Reported by Michael Schmidt <mschmidt at>.


`Rhubarb is no Egyptian god.' Debian brinkmd at
Marcus Brinkmann              GNU    marcus at
Marcus.Brinkmann at

More information about the Gnupg-devel mailing list