about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-08-10 22:18:19 +0100
committerJames Booth <boothj5@gmail.com>2015-08-10 22:18:19 +0100
commite2a528cad46c5da9e950831d5e9a88b8eda6c801 (patch)
tree35d889a8207e23ecc2bff8118072f40501a2ed19
parent0410dd90f1393ad05858a5d42626ddb04bbdd5ad (diff)
downloadprofani-tty-e2a528cad46c5da9e950831d5e9a88b8eda6c801.tar.gz
Free pgp key on connect
-rw-r--r--src/pgp/gpg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pgp/gpg.c b/src/pgp/gpg.c
index 1ca184d0..020fd29a 100644
--- a/src/pgp/gpg.c
+++ b/src/pgp/gpg.c
@@ -146,9 +146,11 @@ p_gpg_on_connect(const char * const barejid)
         if (gerr) {
             log_error("Error loading PGP key id for %s", jid);
             g_error_free(gerr);
+            g_free(keyid);
         } else {
             gpgme_key_t key = NULL;
             error = gpgme_get_key(ctx, keyid, &key, 1);
+            g_free(keyid);
             if (error || key == NULL) {
                 log_error("GPG: Failed to get key. %s %s", gpgme_strsource(error), gpgme_strerror(error));
                 continue;