[Commits] [SCM] claws branch, master, updated. 3.15.0-138-gcc91e29

Colin colin at claws-mail.org
Mon Sep 18 10:03:51 CEST 2017


The branch, master has been updated
       via  cc91e29fb4d18737d648ae2112063440e1cdcc0f (commit)
      from  9b17603ded77a56d10e56e80b9647487e25546da (commit)

Summary of changes:
 src/plugins/pgpcore/select-keys.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


- Log -----------------------------------------------------------------
commit cc91e29fb4d18737d648ae2112063440e1cdcc0f
Author: Colin Leroy <colin at colino.net>
Date:   Mon Sep 18 10:03:39 2017 +0200

    Fix double-free of keys

diff --git a/src/plugins/pgpcore/select-keys.c b/src/plugins/pgpcore/select-keys.c
index 47e4b66..92c228b 100644
--- a/src/plugins/pgpcore/select-keys.c
+++ b/src/plugins/pgpcore/select-keys.c
@@ -167,6 +167,9 @@ static void
 destroy_key (gpointer data)
 {
     gpgme_key_t key = data;
+
+    debug_print("unref key %p\n", key);
+
     gpgme_key_unref (key);
 }
 
@@ -255,6 +258,7 @@ set_row (GtkCMCList *clist, gpgme_key_t key, gpgme_protocol_t proto)
     row = gtk_cmclist_append (clist, (gchar**)text);
     g_free (algo_buf);
 
+    gpgme_key_ref(key);
     gtk_cmclist_set_row_data_full (clist, row, key, destroy_key);
 }
 
@@ -349,7 +353,9 @@ fill_clist (struct select_keys_s *sk, const char *pattern, gpgme_protocol_t prot
     if (exact_match && num_results == 1)
 	    return last_key;
 
-    gpgme_key_unref(last_key);
+    if (last_key != NULL)
+        gpgme_key_unref(last_key);
+
     return NULL;
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list