1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: display error in command if allocation of arraylist fails

This commit is contained in:
Sébastien Helleu
2023-01-12 20:57:47 +01:00
parent 0d622df87a
commit 049c6eb6a8
+4
View File
@@ -107,6 +107,8 @@ COMMAND_CALLBACK(allbuf)
all_buffers = arraylist_new (gui_buffers_count, 0, 0,
NULL, NULL, NULL, NULL);
if (!all_buffers)
COMMAND_ERROR;
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
@@ -1057,6 +1059,8 @@ COMMAND_CALLBACK(buffer)
if (string_strcasecmp (argv[1], "close") == 0)
{
buffers_to_close = arraylist_new (32, 0, 0, NULL, NULL, NULL, NULL);
if (!buffers_to_close)
COMMAND_ERROR;
if (argc < 3)
{