1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05: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

@ -334,11 +334,15 @@ p_gpg_sign(const char * const str, const char * const fp)
if (error || key == NULL) { if (error || key == NULL) {
log_error("GPG: Failed to get key. %s %s", gpgme_strsource(error), gpgme_strerror(error)); 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; return NULL;
} }
gpgme_signers_clear(ctx); gpgme_signers_clear(ctx);
error = gpgme_signers_add(ctx, key); error = gpgme_signers_add(ctx, key);
gpgme_key_unref(key);
if (error) { if (error) {
log_error("GPG: Failed to load signer. %s %s", gpgme_strsource(error), gpgme_strerror(error)); log_error("GPG: Failed to load signer. %s %s", gpgme_strsource(error), gpgme_strerror(error));
gpgme_release(ctx); gpgme_release(ctx);