diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-01-02 13:09:02 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-01-02 13:09:02 +0100 |
commit | 10bf2a866593b0e5eea0838a9772c79d507d36f4 (patch) | |
tree | a7c90b4fea407b73122c2eb936b926862be5a9c3 /src/core | |
parent | 2d82a4a4fcf0955b5c88099f01f65301f9f51b38 (diff) | |
download | weechat-10bf2a866593b0e5eea0838a9772c79d507d36f4.zip |
Test if variables are not NULL before free in function hook_print_exec
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-hook.c | 9 |
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 (); } |