1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-13 00:09:51 +02:00

gpg: Fix memory leak while running --check-trustdb.

* g10/trustdb.c (update_min_ownertrust): Free PK.
--

This bug was revealed by the new trust-pgp-2.scm test.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-08-24 22:06:59 +02:00
parent b065a69634
commit 13821e15fb
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -797,6 +797,7 @@ update_min_ownertrust (ctrl_t ctrl, u32 *kid, unsigned int new_trust)
{ {
log_error (_("public key %s not found: %s\n"), log_error (_("public key %s not found: %s\n"),
keystr (kid), gpg_strerror (err)); keystr (kid), gpg_strerror (err));
xfree (pk);
return; return;
} }
@ -836,6 +837,8 @@ update_min_ownertrust (ctrl_t ctrl, u32 *kid, unsigned int new_trust)
{ {
tdbio_invalid (); tdbio_invalid ();
} }
free_public_key (pk);
} }