mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-21 14:47:03 +01:00
(copy_secret_key): Get last fix right.
This commit is contained in:
parent
5024c31036
commit
c604d59716
@ -1,3 +1,7 @@
|
||||
2004-06-16 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* free-packet.c (copy_secret_key): Get last fix right.
|
||||
|
||||
2004-06-16 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* free-packet.c (copy_secret_key): Fixed memory leak.
|
||||
|
@ -261,21 +261,15 @@ copy_secret_key( PKT_secret_key *d, PKT_secret_key *s )
|
||||
|
||||
if( !d )
|
||||
d = m_alloc(sizeof *d);
|
||||
else
|
||||
release_secret_key_parts (d);
|
||||
memcpy( d, s, sizeof *d );
|
||||
n = pubkey_get_nskey( s->pubkey_algo );
|
||||
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 {
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user