core: fix memory leak in evaluation of sub-conditions

This commit is contained in:
Sebastien Helleu 2014-03-02 17:43:19 +01:00
parent 16c13e94a6
commit 4b57c95494
2 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
== Version 0.4.4 (under dev) == 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 * core: fix memory leak in function gui_key_add_to_infolist (in case of
insufficient memory) insufficient memory)
* core: fix use of invalid pointer in function gui_bar_window_content_alloc * core: fix use of invalid pointer in function gui_bar_window_content_alloc

View File

@ -603,7 +603,11 @@ eval_expression_condition (const char *expr, struct t_hashtable *pointers,
+ 1; + 1;
tmp_value2 = malloc (length); tmp_value2 = malloc (length);
if (!tmp_value2) if (!tmp_value2)
{
if (tmp_value)
free (tmp_value);
goto end; goto end;
}
tmp_value2[0] = '\0'; tmp_value2[0] = '\0';
if (pos > expr2) if (pos > expr2)
{ {
@ -619,6 +623,8 @@ eval_expression_condition (const char *expr, struct t_hashtable *pointers,
} }
free (expr2); free (expr2);
expr2 = tmp_value2; expr2 = tmp_value2;
if (tmp_value)
free (tmp_value);
} }
} }