mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
(copy_secret_key): Fixed memory leak.
This commit is contained in:
parent
20917c3c30
commit
40e66b1af1
1
THANKS
1
THANKS
@ -11,6 +11,7 @@ Anand Kumria wildfire@progsoc.uts.edu.au
|
|||||||
Andreas Haumer andreas@xss.co.at
|
Andreas Haumer andreas@xss.co.at
|
||||||
Anthony Mulcahy anthony@kcn.ne.jp
|
Anthony Mulcahy anthony@kcn.ne.jp
|
||||||
Ariel T Glenn ariel@columbia.edu
|
Ariel T Glenn ariel@columbia.edu
|
||||||
|
Atom 'Smasher' atom@suspicious.org
|
||||||
Bob Mathews bobmathews@mindspring.com
|
Bob Mathews bobmathews@mindspring.com
|
||||||
Bodo Moeller Bodo_Moeller@public.uni-hamburg.de
|
Bodo Moeller Bodo_Moeller@public.uni-hamburg.de
|
||||||
Brendan O'Dea bod@debian.org
|
Brendan O'Dea bod@debian.org
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2004-06-16 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* free-packet.c (copy_secret_key): Fixed memory leak.
|
||||||
|
|
||||||
2004-06-01 David Shaw <dshaw@jabberwocky.com>
|
2004-06-01 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* g10.c (main): Alias --charset as --display-charset to help avoid
|
* g10.c (main): Alias --charset as --display-charset to help avoid
|
||||||
|
@ -264,11 +264,20 @@ copy_secret_key( PKT_secret_key *d, PKT_secret_key *s )
|
|||||||
memcpy( d, s, sizeof *d );
|
memcpy( d, s, sizeof *d );
|
||||||
n = pubkey_get_nskey( s->pubkey_algo );
|
n = pubkey_get_nskey( s->pubkey_algo );
|
||||||
if( !n )
|
if( !n )
|
||||||
|
{
|
||||||
|
if (d->skey[0])
|
||||||
|
mpi_free (d->skey[0]);
|
||||||
d->skey[0] = mpi_copy(s->skey[0]);
|
d->skey[0] = mpi_copy(s->skey[0]);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
for(i=0; i < n; i++ )
|
for(i=0; i < n; i++ )
|
||||||
|
{
|
||||||
|
if (d->skey[i])
|
||||||
|
mpi_free (d->skey[i]);
|
||||||
d->skey[i] = mpi_copy( s->skey[i] );
|
d->skey[i] = mpi_copy( s->skey[i] );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user