2001-11-11 Marcus Brinkmann <marcus@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@cs.uni-sb.de>.
This commit is contained in:
parent
1ecdde3ced
commit
49a25a82e2
@ -1,3 +1,9 @@
|
|||||||
|
2001-11-11 Marcus Brinkmann <marcus@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@cs.uni-sb.de>.
|
||||||
|
|
||||||
2001-11-02 Marcus Brinkmann <marcus@g10code.de>
|
2001-11-02 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
* rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
|
* rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
|
||||||
|
@ -244,34 +244,45 @@ _gpgme_gpg_new ( GpgObject *r_gpg )
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_gpgme_gpg_release ( GpgObject gpg )
|
_gpgme_gpg_release (GpgObject gpg)
|
||||||
{
|
{
|
||||||
if ( !gpg )
|
if (!gpg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
while (gpg->arglist)
|
||||||
|
{
|
||||||
|
struct arg_and_data_s *next = gpg->arglist->next;
|
||||||
|
|
||||||
|
xfree (gpg->arglist);
|
||||||
|
gpg->arglist = next;
|
||||||
|
}
|
||||||
|
|
||||||
xfree (gpg->status.buffer);
|
xfree (gpg->status.buffer);
|
||||||
xfree (gpg->colon.buffer);
|
xfree (gpg->colon.buffer);
|
||||||
if ( gpg->argv )
|
if (gpg->argv)
|
||||||
free_argv (gpg->argv);
|
free_argv (gpg->argv);
|
||||||
|
xfree (gpg->cmd.cb_data);
|
||||||
xfree (gpg->cmd.keyword);
|
xfree (gpg->cmd.keyword);
|
||||||
|
|
||||||
if (gpg->pid != -1)
|
if (gpg->pid != -1)
|
||||||
_gpgme_remove_proc_from_wait_queue ( gpg->pid );
|
_gpgme_remove_proc_from_wait_queue (gpg->pid);
|
||||||
if (gpg->status.fd[0] != -1 )
|
if (gpg->status.fd[0] != -1)
|
||||||
_gpgme_io_close (gpg->status.fd[0]);
|
_gpgme_io_close (gpg->status.fd[0]);
|
||||||
if (gpg->status.fd[1] != -1 )
|
if (gpg->status.fd[1] != -1)
|
||||||
_gpgme_io_close (gpg->status.fd[1]);
|
_gpgme_io_close (gpg->status.fd[1]);
|
||||||
if (gpg->colon.fd[0] != -1 )
|
if (gpg->colon.fd[0] != -1)
|
||||||
_gpgme_io_close (gpg->colon.fd[0]);
|
_gpgme_io_close (gpg->colon.fd[0]);
|
||||||
if (gpg->colon.fd[1] != -1 )
|
if (gpg->colon.fd[1] != -1)
|
||||||
_gpgme_io_close (gpg->colon.fd[1]);
|
_gpgme_io_close (gpg->colon.fd[1]);
|
||||||
free_fd_data_map (gpg->fd_data_map);
|
free_fd_data_map (gpg->fd_data_map);
|
||||||
if (gpg->running) {
|
if (gpg->running)
|
||||||
|
{
|
||||||
int pid = gpg->pid;
|
int pid = gpg->pid;
|
||||||
struct reap_s *r;
|
struct reap_s *r;
|
||||||
|
|
||||||
/* resuse the memory, so that we don't need to allocate another
|
/* Reuse the memory, so that we don't need to allocate another
|
||||||
* mem block and have to handle errors */
|
memory block and to handle errors. */
|
||||||
assert (sizeof *r < sizeof *gpg );
|
assert (sizeof *r < sizeof *gpg);
|
||||||
r = (void*)gpg;
|
r = (void*)gpg;
|
||||||
memset (r, 0, sizeof *r);
|
memset (r, 0, sizeof *r);
|
||||||
r->pid = pid;
|
r->pid = pid;
|
||||||
|
Loading…
Reference in New Issue
Block a user