aboutsummaryrefslogtreecommitdiffstats
path: root/g10/trustdb.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-08-24 20:06:59 +0000
committerWerner Koch <[email protected]>2017-08-24 20:10:44 +0000
commit13821e15fb9bdddfce79d88731c0f151724b2371 (patch)
tree9edf9104488fe3d1679920dc14abfb5533b7edb9 /g10/trustdb.c
parentgpg: Fix memory leak in sig-check. (diff)
downloadgnupg-13821e15fb9bdddfce79d88731c0f151724b2371.tar.gz
gnupg-13821e15fb9bdddfce79d88731c0f151724b2371.zip
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 <[email protected]>
Diffstat (limited to 'g10/trustdb.c')
-rw-r--r--g10/trustdb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/g10/trustdb.c b/g10/trustdb.c
index e2c3bdaa9..92c1ca50a 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -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);
}