1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Dereference pgp key

This commit is contained in:
James Booth 2015-08-09 00:54:11 +01:00
parent 70c0eeed1e
commit 3b79d5aa63

View File

@ -333,12 +333,16 @@ p_gpg_sign(const char * const str, const char * const fp)
error = gpgme_get_key(ctx, fp, &key, 1);
if (error || key == NULL) {
log_error("GPG: Failed to get key. %s %s", gpgme_strsource(error), gpgme_strerror(error));
gpgme_release (ctx);
gpgme_release(ctx);
if (key) {
gpgme_key_unref(key);
}
return NULL;
}
gpgme_signers_clear(ctx);
error = gpgme_signers_add(ctx, key);
gpgme_key_unref(key);
if (error) {
log_error("GPG: Failed to load signer. %s %s", gpgme_strsource(error), gpgme_strerror(error));
gpgme_release(ctx);