From 07b7be0357b262af552c9e61cee1b257b383043b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Thu, 4 May 2017 07:29:24 +0200 Subject: core: fix memory leak in display of mouse event debug info --- ChangeLog.adoc | 1 + src/gui/gui-key.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index e8f3cc474..273be46a1 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -44,6 +44,7 @@ Improvements:: Bug fixes:: + * core: fix memory leak in display of mouse event debug info * core: fix command /cursor stop (do not toggle cursor mode) (issue #964) * core: fix delayed refresh when the signal SIGWINCH is received (terminal resized), send signal "signal_sigwinch" after refreshes (issue #902) * irc: fix crash in case of invalid server reply during SASL authentication with dh-blowfish or dh-aes mechanism diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c index b4882b258..1fcfcb82c 100644 --- a/src/gui/gui-key.c +++ b/src/gui/gui-key.c @@ -1107,12 +1107,16 @@ gui_key_focus_command (const char *key, int context, { gui_chat_printf (NULL, _("Hashtable focus:")); list_keys = hashtable_get_list_keys (hashtable); - for (ptr_item = list_keys->items; ptr_item; - ptr_item = ptr_item->next_item) + if (list_keys) { - gui_chat_printf (NULL, " %s: \"%s\"", - ptr_item->data, - hashtable_get (hashtable, ptr_item->data)); + for (ptr_item = list_keys->items; ptr_item; + ptr_item = ptr_item->next_item) + { + gui_chat_printf (NULL, " %s: \"%s\"", + ptr_item->data, + hashtable_get (hashtable, ptr_item->data)); + } + weelist_free (list_keys); } } if (debug) -- cgit v1.2.3