mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
g10: Release resources when returning an error in get_seckey.
* g10/getkey.c (get_seckey): If the key doesn't have a secret key, release *PK. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>.
This commit is contained in:
parent
cab581c486
commit
1b601de06a
1 changed files with 5 additions and 1 deletions
|
@ -562,7 +562,11 @@ get_seckey (PKT_public_key *pk, u32 *keyid)
|
|||
release_kbnode (keyblock);
|
||||
|
||||
if (!err)
|
||||
err = agent_probe_secret_key (/*ctrl*/NULL, pk);
|
||||
{
|
||||
err = agent_probe_secret_key (/*ctrl*/NULL, pk);
|
||||
if (err)
|
||||
release_public_key_parts (pk);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue