diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2024-04-24 23:28:37 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-04-25 20:59:24 +0200 |
commit | 2bbf289635aaa44fe05e2da0f48583c099080a34 (patch) | |
tree | 72deb215d0fb87bc860d1a104bc2e0a145309efa /src/plugins/irc/irc-redirect.c | |
parent | f3a9bfe55e7f7a574681a695d3ba99455feb08ed (diff) | |
download | weechat-2bbf289635aaa44fe05e2da0f48583c099080a34.zip |
irc: remove check of NULL pointers before calling free() (issue #865)
Diffstat (limited to 'src/plugins/irc/irc-redirect.c')
-rw-r--r-- | src/plugins/irc/irc-redirect.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/plugins/irc/irc-redirect.c b/src/plugins/irc/irc-redirect.c index ae417e089..69b04e2c3 100644 --- a/src/plugins/irc/irc-redirect.c +++ b/src/plugins/irc/irc-redirect.c @@ -362,14 +362,10 @@ irc_redirect_pattern_free (struct t_irc_redirect_pattern *redirect_pattern) (redirect_pattern->next_redirect)->prev_redirect = redirect_pattern->prev_redirect; /* free data */ - if (redirect_pattern->name) - free (redirect_pattern->name); - if (redirect_pattern->cmd_start) - free (redirect_pattern->cmd_start); - if (redirect_pattern->cmd_stop) - free (redirect_pattern->cmd_stop); - if (redirect_pattern->cmd_extra) - free (redirect_pattern->cmd_extra); + free (redirect_pattern->name); + free (redirect_pattern->cmd_start); + free (redirect_pattern->cmd_stop); + free (redirect_pattern->cmd_extra); free (redirect_pattern); @@ -977,14 +973,10 @@ irc_redirect_free (struct t_irc_redirect *redirect) } /* free data */ - if (redirect->pattern) - free (redirect->pattern); - if (redirect->signal) - free (redirect->signal); - if (redirect->string) - free (redirect->string); - if (redirect->command) - free (redirect->command); + free (redirect->pattern); + free (redirect->signal); + free (redirect->string); + free (redirect->command); if (redirect->cmd_start) weechat_hashtable_free (redirect->cmd_start); if (redirect->cmd_stop) @@ -993,8 +985,7 @@ irc_redirect_free (struct t_irc_redirect *redirect) weechat_hashtable_free (redirect->cmd_extra); if (redirect->cmd_filter) weechat_hashtable_free (redirect->cmd_filter); - if (redirect->output) - free (redirect->output); + free (redirect->output); free (redirect); |