tests: Fix additional memleaks in thread tests

* tests/gpg/t-thread-keylist-verify.c (start_verify): Release
data.
(start_keylist): Unref keys.
* tests/gpg/t-thread-keylist.c (start_keylist): Unref keys.
This commit is contained in:
Andre Heinecke 2016-11-10 15:04:17 +01:00
parent 4d5174e4a8
commit d0030efb45
2 changed files with 10 additions and 2 deletions

View File

@ -60,7 +60,10 @@ start_keylist (void *arg)
err = gpgme_op_keylist_start (ctx, NULL, 0);
fail_if_err (err);
while (!(err = gpgme_op_keylist_next (ctx, &key)));
while (!(err = gpgme_op_keylist_next (ctx, &key)))
{
gpgme_key_unref (key);
}
gpgme_release (ctx);
return NULL;
@ -103,6 +106,8 @@ start_verify (void *arg)
__FILE__, __LINE__, gpgme_strerror (signature->status));
exit (1);
}
gpgme_free (text);
gpgme_free (sig);
gpgme_release (ctx);
return NULL;
}

View File

@ -48,7 +48,10 @@ start_keylist (void *arg)
err = gpgme_op_keylist_start (ctx, NULL, 0);
fail_if_err (err);
while (!(err = gpgme_op_keylist_next (ctx, &key)));
while (!(err = gpgme_op_keylist_next (ctx, &key)))
{
gpgme_key_unref (key);
}
gpgme_release (ctx);