talons

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

commit a7cdcbf8b2d2ca45eebe1221065dab75255d5276
parent 69e78a5c4ea363205d4bbe2cbc56aea45768acd6
Author: wwp <wwp@free.fr>
Date:   Mon, 26 Mar 2018 14:01:26 +0200

Remove key and free attribute value only if they are valid,
clears CID 1220202.

Diffstat:
Msrc/plugins/perl/perl_plugin.c | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/plugins/perl/perl_plugin.c b/src/plugins/perl/perl_plugin.c @@ -430,10 +430,11 @@ static void insert_attribute_hash(gchar *attr) if((tl = g_hash_table_lookup(attribute_hash,attr)) != NULL) { gpointer origkey; gpointer value; - g_hash_table_lookup_extended(attribute_hash,attr,&origkey,&value); - g_hash_table_remove(attribute_hash,origkey); - free_attribute_hash_key(origkey,value,NULL); - debug_print("Existing key `%s' freed.\n",attr); + if (g_hash_table_lookup_extended(attribute_hash,attr,&origkey,&value)) { + g_hash_table_remove(attribute_hash,origkey); + free_attribute_hash_key(origkey,value,NULL); + debug_print("Existing key `%s' freed.\n",attr); + } } tl = g_new0(PerlPluginTimedSList,1);