mirror of
https://github.com/weechat/weechat.git
synced 2026-07-10 11:43:13 +02:00
plugins: remove check of NULL pointers before calling weechat_hashtable_free() (issue #865)
This commit is contained in:
@@ -1445,7 +1445,6 @@ error:
|
||||
remote->name);
|
||||
free (url);
|
||||
free (body);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -187,9 +187,7 @@ relay_irc_message_parse (const char *message)
|
||||
}
|
||||
|
||||
end:
|
||||
if (hash_msg)
|
||||
weechat_hashtable_free (hash_msg);
|
||||
|
||||
weechat_hashtable_free (hash_msg);
|
||||
return hash_parsed;
|
||||
}
|
||||
|
||||
@@ -290,10 +288,8 @@ relay_irc_sendf (struct t_relay_client *client, const char *format, ...)
|
||||
|
||||
end:
|
||||
free (new_msg1);
|
||||
if (hashtable_in)
|
||||
weechat_hashtable_free (hashtable_in);
|
||||
if (hashtable_out)
|
||||
weechat_hashtable_free (hashtable_out);
|
||||
weechat_hashtable_free (hashtable_in);
|
||||
weechat_hashtable_free (hashtable_out);
|
||||
free (vbuffer);
|
||||
}
|
||||
|
||||
@@ -2161,8 +2157,7 @@ relay_irc_recv (struct t_relay_client *client, const char *data)
|
||||
|
||||
end:
|
||||
free (new_data);
|
||||
if (hash_parsed)
|
||||
weechat_hashtable_free (hash_parsed);
|
||||
weechat_hashtable_free (hash_parsed);
|
||||
free (params);
|
||||
}
|
||||
|
||||
|
||||
@@ -284,6 +284,5 @@ relay_buffer_open ()
|
||||
&relay_buffer_input_cb, NULL, NULL,
|
||||
&relay_buffer_close_cb, NULL, NULL);
|
||||
|
||||
if (buffer_props)
|
||||
weechat_hashtable_free (buffer_props);
|
||||
weechat_hashtable_free (buffer_props);
|
||||
}
|
||||
|
||||
@@ -1337,13 +1337,10 @@ relay_http_request_free (struct t_relay_http_request *request)
|
||||
free (request->path);
|
||||
if (request->path_items)
|
||||
weechat_string_free_split (request->path_items);
|
||||
if (request->params)
|
||||
weechat_hashtable_free (request->params);
|
||||
weechat_hashtable_free (request->params);
|
||||
free (request->http_version);
|
||||
if (request->headers)
|
||||
weechat_hashtable_free (request->headers);
|
||||
if (request->accept_encoding)
|
||||
weechat_hashtable_free (request->accept_encoding);
|
||||
weechat_hashtable_free (request->headers);
|
||||
weechat_hashtable_free (request->accept_encoding);
|
||||
if (request->ws_deflate)
|
||||
relay_websocket_deflate_free (request->ws_deflate);
|
||||
free (request->body);
|
||||
@@ -1588,8 +1585,7 @@ relay_http_response_free (struct t_relay_http_response *response)
|
||||
{
|
||||
free (response->http_version);
|
||||
free (response->message);
|
||||
if (response->headers)
|
||||
weechat_hashtable_free (response->headers);
|
||||
weechat_hashtable_free (response->headers);
|
||||
free (response->body);
|
||||
|
||||
free (response);
|
||||
|
||||
@@ -81,8 +81,7 @@ relay_network_set_tls_cert_key (int verbose)
|
||||
weechat_hashtable_set (options, "directory", "config");
|
||||
certkey_path = weechat_string_eval_path_home (ptr_path,
|
||||
NULL, NULL, options);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
if (certkey_path && certkey_path[0])
|
||||
{
|
||||
|
||||
@@ -101,8 +101,7 @@ relay_raw_open (int switch_to_buffer)
|
||||
buffer_props,
|
||||
&relay_buffer_input_cb, NULL, NULL,
|
||||
&relay_buffer_close_cb, NULL, NULL);
|
||||
if (buffer_props)
|
||||
weechat_hashtable_free (buffer_props);
|
||||
weechat_hashtable_free (buffer_props);
|
||||
|
||||
/* failed to create buffer ? then return */
|
||||
if (!relay_raw_buffer)
|
||||
|
||||
@@ -851,8 +851,7 @@ relay_server_new (const char *protocol_string, enum t_relay_protocol protocol,
|
||||
weechat_hashtable_set (options, "directory", "runtime");
|
||||
new_server->path = weechat_string_eval_path_home (path,
|
||||
NULL, NULL, options);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
new_server->ipv4 = ipv4;
|
||||
new_server->ipv6 = ipv6;
|
||||
new_server->tls = tls;
|
||||
@@ -900,8 +899,7 @@ relay_server_update_path (struct t_relay_server *server, const char *path)
|
||||
if (options)
|
||||
weechat_hashtable_set (options, "directory", "runtime");
|
||||
new_path = weechat_string_eval_path_home (path, NULL, NULL, options);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
if (!new_path)
|
||||
return;
|
||||
|
||||
|
||||
@@ -317,13 +317,11 @@ relay_weechat_free (struct t_relay_client *client)
|
||||
|
||||
if (client->protocol_data)
|
||||
{
|
||||
if (RELAY_WEECHAT_DATA(client, buffers_sync))
|
||||
weechat_hashtable_free (RELAY_WEECHAT_DATA(client, buffers_sync));
|
||||
weechat_hashtable_free (RELAY_WEECHAT_DATA(client, buffers_sync));
|
||||
weechat_unhook (RELAY_WEECHAT_DATA(client, hook_signal_buffer));
|
||||
weechat_unhook (RELAY_WEECHAT_DATA(client, hook_hsignal_nicklist));
|
||||
weechat_unhook (RELAY_WEECHAT_DATA(client, hook_signal_upgrade));
|
||||
if (RELAY_WEECHAT_DATA(client, buffers_nicklist))
|
||||
weechat_hashtable_free (RELAY_WEECHAT_DATA(client, buffers_nicklist));
|
||||
weechat_hashtable_free (RELAY_WEECHAT_DATA(client, buffers_nicklist));
|
||||
weechat_unhook (RELAY_WEECHAT_DATA(client, hook_timer_nicklist));
|
||||
|
||||
free (client->protocol_data);
|
||||
|
||||
Reference in New Issue
Block a user