diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2019-10-07 03:41:01 +0200 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2019-10-07 03:41:01 +0200 |
commit | e28572116fe4c586ba9d1e8f27389bf3f06e036b (patch) | |
tree | a48a143eb9013ed9ca0aaec85209973d60662c40 /g10/getkey.c | |
parent | gpg: Ignore all SHA-1 signatures in 3rd party key signatures. (diff) | |
download | gnupg2-e28572116fe4c586ba9d1e8f27389bf3f06e036b.tar.xz gnupg2-e28572116fe4c586ba9d1e8f27389bf3f06e036b.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | g10/getkey.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/g10/getkey.c b/g10/getkey.c index 57079fa4d..6802026f6 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -1484,7 +1484,10 @@ get_best_pubkey_byname (ctrl_t ctrl, enum get_pubkey_modes mode, } if (pk) - *pk = best.key; + { + release_public_key_parts (pk); + *pk = best.key; + } else release_public_key_parts (&best.key); } |