mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Fix a memory leak in get_best_pubkey_byname.
* g10/getkey.c (get_best_pubkey_byname): Free the public key parts. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
7d9aad63c4
commit
e28572116f
1 changed files with 4 additions and 1 deletions
|
@ -1484,7 +1484,10 @@ get_best_pubkey_byname (ctrl_t ctrl, enum get_pubkey_modes mode,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pk)
|
if (pk)
|
||||||
*pk = best.key;
|
{
|
||||||
|
release_public_key_parts (pk);
|
||||||
|
*pk = best.key;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
release_public_key_parts (&best.key);
|
release_public_key_parts (&best.key);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue