diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2024-04-25 19:01:56 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-04-26 08:53:22 +0200 |
commit | 0b2d9bcb9b04b7e7ac3c2f626422392383575d2b (patch) | |
tree | 177e487efc30717415402ba969b246de3f88b28d /src/plugins/irc/irc-server.c | |
parent | 1ad0b4b6699df50e0cc6a3c5d62ce3ac1f77440c (diff) | |
download | weechat-0b2d9bcb9b04b7e7ac3c2f626422392383575d2b.zip |
plugins: remove check of NULL pointers before calling weechat_hashtable_free() (issue #865)
Diffstat (limited to 'src/plugins/irc/irc-server.c')
-rw-r--r-- | src/plugins/irc/irc-server.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index d6051b2c7..066f11ab3 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -378,10 +378,8 @@ irc_server_eval_expression (struct t_irc_server *server, const char *string) value = weechat_string_eval_expression (string, pointers, extra_vars, NULL); - if (pointers) - weechat_hashtable_free (pointers); - if (extra_vars) - weechat_hashtable_free (extra_vars); + weechat_hashtable_free (pointers); + weechat_hashtable_free (extra_vars); return value; } @@ -1582,8 +1580,7 @@ irc_server_get_default_msg (const char *default_msg, msg = weechat_string_eval_expression (default_msg, NULL, extra_vars, NULL); - if (extra_vars) - weechat_hashtable_free (extra_vars); + weechat_hashtable_free (extra_vars); return msg; } @@ -2310,10 +2307,8 @@ irc_server_free_data (struct t_irc_server *server) free (server->nick); free (server->nick_modes); free (server->host); - if (server->cap_ls) - weechat_hashtable_free (server->cap_ls); - if (server->cap_list) - weechat_hashtable_free (server->cap_list); + weechat_hashtable_free (server->cap_ls); + weechat_hashtable_free (server->cap_list); free (server->isupport); free (server->prefix_modes); free (server->prefix_chars); @@ -4763,8 +4758,7 @@ irc_server_create_buffer (struct t_irc_server *server) buffer_props, &irc_input_data_cb, NULL, NULL, &irc_buffer_close_cb, NULL, NULL); - if (buffer_props) - weechat_hashtable_free (buffer_props); + weechat_hashtable_free (buffer_props); if (!server->buffer) return NULL; @@ -5248,8 +5242,7 @@ irc_server_gnutls_callback (const void *pointer, void *data, weechat_hashtable_set (options, "directory", "config"); cert_path = weechat_string_eval_path_home (ptr_cert_path, NULL, NULL, options); - if (options) - weechat_hashtable_free (options); + weechat_hashtable_free (options); if (cert_path) { cert_str = weechat_file_get_content (cert_path); |