mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
gpg: Fix a memory leak in get_best_pubkey_byname.
* g10/getkey.c (get_best_pubkey_byname): Free the public key parts. -- Cherry-picked from master commit: e28572116fe4c586ba9d1e8f27389bf3f06e036b Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
beeab41e47
commit
2924ac374e
@ -1572,7 +1572,10 @@ get_best_pubkey_byname (ctrl_t ctrl, enum get_pubkey_modes mode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pk)
|
if (pk)
|
||||||
|
{
|
||||||
|
release_public_key_parts (pk);
|
||||||
*pk = best.key;
|
*pk = best.key;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
release_public_key_parts (&best.key);
|
release_public_key_parts (&best.key);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user