mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
core: fix use of invalid pointer in function gui_bar_window_content_alloc (in case of insufficient memory)
This commit is contained in:
@@ -13,6 +13,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
|
||||
== Version 0.4.4 (under dev)
|
||||
|
||||
* 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
|
||||
* core: fix memory leak and use of invalid pointer in split of string (in case
|
||||
of insufficient memory)
|
||||
|
||||
@@ -433,19 +433,23 @@ gui_bar_window_content_alloc (struct t_gui_bar_window *bar_window)
|
||||
bar_window->items_refresh_needed = NULL;
|
||||
bar_window->screen_col_size = 0;
|
||||
bar_window->screen_lines = 0;
|
||||
bar_window->items_subcount = malloc (bar_window->items_count *
|
||||
bar_window->items_subcount = calloc (1,
|
||||
bar_window->items_count *
|
||||
sizeof (*bar_window->items_subcount));
|
||||
if (!bar_window->items_subcount)
|
||||
goto error;
|
||||
bar_window->items_content = malloc ((bar_window->items_count) *
|
||||
bar_window->items_content = calloc (1,
|
||||
(bar_window->items_count) *
|
||||
sizeof (*bar_window->items_content));
|
||||
if (!bar_window->items_content)
|
||||
goto error;
|
||||
bar_window->items_num_lines = malloc ((bar_window->items_count) *
|
||||
bar_window->items_num_lines = calloc (1,
|
||||
(bar_window->items_count) *
|
||||
sizeof (*bar_window->items_num_lines));
|
||||
if (!bar_window->items_num_lines)
|
||||
goto error;
|
||||
bar_window->items_refresh_needed = malloc (bar_window->items_count *
|
||||
bar_window->items_refresh_needed = calloc (1,
|
||||
bar_window->items_count *
|
||||
sizeof (*bar_window->items_refresh_needed));
|
||||
if (!bar_window->items_refresh_needed)
|
||||
goto error;
|
||||
|
||||
Reference in New Issue
Block a user