mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 21:36:37 +02:00
Fix crash with filters and day change lines
This commit is contained in:
+2
-1
@@ -532,7 +532,8 @@ gui_chat_line_match_regex (struct t_gui_line *line, regex_t *regex_prefix,
|
||||
match_prefix = 1;
|
||||
match_message = 1;
|
||||
|
||||
prefix = (char *)gui_color_decode ((unsigned char *)line->prefix);
|
||||
prefix = (line->prefix) ?
|
||||
(char *)gui_color_decode ((unsigned char *)line->prefix) : NULL;
|
||||
if (prefix && regex_prefix)
|
||||
{
|
||||
if (regexec (regex_prefix, prefix, 0, NULL, 0) != 0)
|
||||
|
||||
+10
-4
@@ -235,6 +235,9 @@ gui_color_decode (const unsigned char *string)
|
||||
unsigned char *out;
|
||||
int out_length, out_pos, length;
|
||||
|
||||
if (!string)
|
||||
return NULL;
|
||||
|
||||
out_length = (strlen ((char *)string) * 2) + 1;
|
||||
out = malloc (out_length);
|
||||
if (!out)
|
||||
@@ -294,8 +297,11 @@ gui_color_decode (const unsigned char *string)
|
||||
void
|
||||
gui_color_free (struct t_gui_color *color)
|
||||
{
|
||||
if (color->string)
|
||||
free (color->string);
|
||||
|
||||
free (color);
|
||||
if (color)
|
||||
{
|
||||
if (color->string)
|
||||
free (color->string);
|
||||
|
||||
free (color);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user