talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 764fcdc60bd2c0c717bf699f13d45eb23de99031
parent faf5411f3c7b7a76950d91b232072eb98857988a
Author: Colin Leroy <colin@colino.net>
Date:   Mon, 17 Mar 2014 14:59:54 +0100

Fix crash due to wrong use of the gpointer source (which is a
pointer-to-pointer to GList), replace exit() with return.

Diffstat:
Msrc/plugins/pgpcore/autocompletion.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/plugins/pgpcore/autocompletion.c b/src/plugins/pgpcore/autocompletion.c @@ -39,6 +39,7 @@ static gboolean pgp_autocompletion_hook(gpointer source, gpointer data) gpgme_error_t err; gpgme_user_id_t uid; address_entry *ae; + GList *addr_list = NULL; /* just return if autocompletion is disabled */ if (!prefs_gpg_get_config()->autocompletion) @@ -75,7 +76,7 @@ static gboolean pgp_autocompletion_hook(gpointer source, gpointer data) ae->grp_emails = NULL; - source = g_list_prepend(source, ae); + addr_list = g_list_prepend(addr_list, ae); debug_print("%s <%s>\n", uid->name, uid->email); } @@ -89,8 +90,9 @@ static gboolean pgp_autocompletion_hook(gpointer source, gpointer data) if (gpg_err_code(err) != GPG_ERR_EOF) { debug_print("can not list keys: %s\n", gpgme_strerror(err)); - exit(EXIT_FAILURE); + return EXIT_FAILURE; } + *((GList **)source) = addr_list; return EXIT_SUCCESS; }