diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2014-03-02 17:43:19 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2014-03-02 17:43:19 +0100 |
commit | 4b57c95494b5a4cbcc52a4e841c1a0724ed21725 (patch) | |
tree | 1c80f5003c41b36ede648eebcd096be4ab86a18e | |
parent | 16c13e94a6ab5e25fdf8366891264706db566838 (diff) | |
download | weechat-4b57c95494b5a4cbcc52a4e841c1a0724ed21725.zip |
core: fix memory leak in evaluation of sub-conditions
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/core/wee-eval.c | 6 |
2 files changed, 7 insertions, 0 deletions
@@ -13,6 +13,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] == Version 0.4.4 (under dev) +* core: fix memory leak in evaluation of sub-conditions * 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 diff --git a/src/core/wee-eval.c b/src/core/wee-eval.c index 88596cec8..01243c198 100644 --- a/src/core/wee-eval.c +++ b/src/core/wee-eval.c @@ -603,7 +603,11 @@ eval_expression_condition (const char *expr, struct t_hashtable *pointers, + 1; tmp_value2 = malloc (length); if (!tmp_value2) + { + if (tmp_value) + free (tmp_value); goto end; + } tmp_value2[0] = '\0'; if (pos > expr2) { @@ -619,6 +623,8 @@ eval_expression_condition (const char *expr, struct t_hashtable *pointers, } free (expr2); expr2 = tmp_value2; + if (tmp_value) + free (tmp_value); } } |