memory leak in gpgme

Werner Koch wk at gnupg.org
Fri Nov 9 11:21:02 CET 2001


On Fri, 9 Nov 2001 09:54:26 +0100 (CET), Michael Schmidt said:

> I figured out, that there is a memory leak in the '_gpgme_gpg_release'
> function: the argument list is not released. I wrote a small patch,

Quite possible.

>      }
> +    gpg->arglist = NULL;

Not needed because the gpg is zeroed (yes, I know that there used to
be strange machines where you can't do that with pointers).

> +	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.

Thanks,

  Werner

-- 
Werner Koch        Omnis enim res, quae dando non deficit, dum habetur
g10 Code GmbH      et non datur, nondum habetur, quomodo habenda est.
Privacy Solutions                                        -- Augustinus





More information about the Gnupg-devel mailing list