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
1 changed files with 3 additions and 0 deletions

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"),
keystr (kid), gpg_strerror (err));
xfree (pk);
return;
}
@ -836,6 +837,8 @@ update_min_ownertrust (ctrl_t ctrl, u32 *kid, unsigned int new_trust)
{
tdbio_invalid ();
}
free_public_key (pk);
}