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

Test if variables are not NULL before free in function hook_print_exec

This commit is contained in:
Sebastien Helleu
2011-01-02 13:09:02 +01:00
parent 2d82a4a4fc
commit 10bf2a8665
+6 -3
View File
@@ -1804,7 +1804,8 @@ hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line)
message_no_color = gui_color_decode (line->data->message, NULL);
if (!message_no_color)
{
free (prefix_no_color);
if (prefix_no_color)
free (prefix_no_color);
return;
}
@@ -1876,8 +1877,10 @@ hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line)
ptr_hook = next_hook;
}
free (prefix_no_color);
free (message_no_color);
if (prefix_no_color)
free (prefix_no_color);
if (message_no_color)
free (message_no_color);
hook_exec_end ();
}