summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-02-22 15:22:27 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-02-22 15:22:27 +0100
commita0651e11bd34a45d2a6f6db49fe0448ab154e548 (patch)
treebca9b4a9d921ac203e759af179c715f433d31045
parentb8f07e935af22380e0aee7944523fc3f32294d1e (diff)
downloadweechat-a0651e11bd34a45d2a6f6db49fe0448ab154e548.zip
core: fix memory leak in function gui_key_add_to_infolist (in case of insufficient memory)
-rw-r--r--ChangeLog2
-rw-r--r--src/gui/gui-key.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 739c07da1..f26cca636 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
== Version 0.4.4 (under dev)
+* core: fix memory leak in function gui_key_add_to_infolist (in case of
+ insufficient memory)
* core: fix use of invalid pointer in function gui_bar_window_content_alloc
(in case of insufficient memory)
* core: fix uninitialized value in function string_decode_base64
diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c
index 9904b5759..9c66ddf7b 100644
--- a/src/gui/gui-key.c
+++ b/src/gui/gui-key.c
@@ -1914,7 +1914,10 @@ gui_key_add_to_infolist (struct t_infolist *infolist, struct t_gui_key *key)
if (expanded_key)
{
if (!infolist_new_var_string (ptr_item, "key", expanded_key))
+ {
+ free (expanded_key);
return 0;
+ }
free (expanded_key);
}
if (!infolist_new_var_integer (ptr_item, "area_type1", key->area_type[0]))