1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 09:43:13 +02:00

irc: remove check of NULL pointers before calling free() (issue #865)

This commit is contained in:
Sébastien Helleu
2024-04-24 23:28:37 +02:00
parent f3a9bfe55e
commit 2bbf289635
26 changed files with 374 additions and 752 deletions
+6 -12
View File
@@ -103,8 +103,7 @@ irc_color_convert_rgb2term (long rgb)
info_color = weechat_info_get ("color_rgb2term", str_color);
if (!info_color || !info_color[0])
{
if (info_color)
free (info_color);
free (info_color);
return -1;
}
@@ -144,8 +143,7 @@ irc_color_convert_rgb2irc (long rgb)
info_color = weechat_info_get ("color_rgb2term", str_color);
if (!info_color || !info_color[0])
{
if (info_color)
free (info_color);
free (info_color);
return -1;
}
@@ -180,8 +178,7 @@ irc_color_convert_term2irc (int color)
info_color = weechat_info_get ("color_term2rgb", str_color);
if (!info_color || !info_color[0])
{
if (info_color)
free (info_color);
free (info_color);
return -1;
}
@@ -924,8 +921,7 @@ irc_color_decode_ansi_cb (void *data, const char *text)
end:
if (items)
weechat_string_free_split (items);
if (text2)
free (text2);
free (text2);
return (output) ? output : strdup ("");
}
@@ -956,14 +952,12 @@ irc_color_decode_ansi (const char *string, int keep_colors)
ansi_regex,
REG_EXTENDED) != 0)
{
if (ansi_regex)
free (ansi_regex);
free (ansi_regex);
free (irc_color_regex_ansi);
irc_color_regex_ansi = NULL;
return NULL;
}
if (ansi_regex)
free (ansi_regex);
free (ansi_regex);
}
ansi_state.keep_colors = keep_colors;