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:
+6
-3
@@ -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 ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user