1
0
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:
Sebastien Helleu
2008-08-24 09:12:06 +02:00
parent b009f29021
commit 2b8aa56917
2 changed files with 12 additions and 5 deletions
+2 -1
View File
@@ -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
View File
@@ -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);
}
}