1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 13:26:38 +02:00

core: fix use of NULL pointer (in case of malloc error) when creating a new filter

This commit is contained in:
Sebastien Helleu
2013-12-15 19:50:56 +01:00
parent 4c3d090184
commit 2f3d712a62
+7 -4
View File
@@ -355,11 +355,14 @@ gui_filter_new (int enabled, const char *name, const char *buffer_name,
{
new_filter->tags_array = malloc (new_filter->tags_count *
sizeof (*new_filter->tags_array));
for (i = 0; i < new_filter->tags_count; i++)
if (new_filter->tags_array)
{
new_filter->tags_array[i] = string_split (tags_array[i],
"+", 0, 0,
NULL);
for (i = 0; i < new_filter->tags_count; i++)
{
new_filter->tags_array[i] = string_split (tags_array[i],
"+", 0, 0,
NULL);
}
}
string_free_split (tags_array);
}