summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-hook.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c
index 6bce94883..67478bd6d 100644
--- a/src/core/wee-hook.c
+++ b/src/core/wee-hook.c
@@ -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 ();
}