summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-01-12 20:57:47 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-01-12 20:57:47 +0100
commit049c6eb6a8f1ec28f211f0c93ace99c343dd25a0 (patch)
tree93c288e83ec0acfba2ae7cacd2fff90a340eb36f /src/core
parent0d622df87afffda1963b9c1462f4fdebd811d519 (diff)
downloadweechat-049c6eb6a8f1ec28f211f0c93ace99c343dd25a0.zip
core: display error in command if allocation of arraylist fails
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-command.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 4be1b6a16..0e95b7869 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -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)
{