mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 06:46:38 +02:00
plugins: remove check of NULL pointers before calling weechat_hashtable_free() (issue #865)
This commit is contained in:
@@ -189,8 +189,7 @@ exec_buffer_new (const char *name, int free_content, int clear_buffer,
|
||||
&exec_buffer_input_cb, NULL, NULL,
|
||||
&exec_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 (!new_buffer)
|
||||
|
||||
@@ -644,8 +644,7 @@ error:
|
||||
free (shell);
|
||||
if (new_exec_cmd)
|
||||
exec_free (new_exec_cmd);
|
||||
if (process_options)
|
||||
weechat_hashtable_free (process_options);
|
||||
weechat_hashtable_free (process_options);
|
||||
|
||||
return WEECHAT_RC_ERROR;
|
||||
}
|
||||
|
||||
@@ -83,8 +83,7 @@ fifo_create ()
|
||||
fifo_filename = weechat_string_eval_path_home (
|
||||
weechat_config_string (fifo_config_file_path),
|
||||
NULL, NULL, options);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
}
|
||||
|
||||
if (!fifo_filename)
|
||||
|
||||
@@ -1597,8 +1597,7 @@ fset_buffer_open ()
|
||||
&fset_buffer_input_cb, NULL, NULL,
|
||||
&fset_buffer_close_cb, NULL, NULL);
|
||||
|
||||
if (buffer_props)
|
||||
weechat_hashtable_free (buffer_props);
|
||||
weechat_hashtable_free (buffer_props);
|
||||
|
||||
if (!fset_buffer)
|
||||
return;
|
||||
|
||||
@@ -559,10 +559,8 @@ fset_command_run_set_cb (const void *pointer, void *data,
|
||||
condition_ok = (result && (strcmp (result, "1") == 0));
|
||||
free (result);
|
||||
}
|
||||
if (eval_extra_vars)
|
||||
weechat_hashtable_free (eval_extra_vars);
|
||||
if (eval_options)
|
||||
weechat_hashtable_free (eval_options);
|
||||
weechat_hashtable_free (eval_extra_vars);
|
||||
weechat_hashtable_free (eval_options);
|
||||
|
||||
/* check condition to trigger the fset buffer */
|
||||
if (condition_ok)
|
||||
|
||||
@@ -1405,10 +1405,8 @@ fset_option_export (const char *filename, int with_help)
|
||||
|
||||
fclose (file);
|
||||
|
||||
if (hashtable_pointers)
|
||||
weechat_hashtable_free (hashtable_pointers);
|
||||
if (hashtable_extra_vars)
|
||||
weechat_hashtable_free (hashtable_extra_vars);
|
||||
weechat_hashtable_free (hashtable_pointers);
|
||||
weechat_hashtable_free (hashtable_extra_vars);
|
||||
free (filename2);
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -534,12 +534,9 @@ weechat_guile_api_string_eval_expression (SCM expr, SCM pointers,
|
||||
c_pointers, c_extra_vars,
|
||||
c_options);
|
||||
|
||||
if (c_pointers)
|
||||
weechat_hashtable_free (c_pointers);
|
||||
if (c_extra_vars)
|
||||
weechat_hashtable_free (c_extra_vars);
|
||||
if (c_options)
|
||||
weechat_hashtable_free (c_options);
|
||||
weechat_hashtable_free (c_pointers);
|
||||
weechat_hashtable_free (c_extra_vars);
|
||||
weechat_hashtable_free (c_options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -577,12 +574,9 @@ weechat_guile_api_string_eval_path_home (SCM path, SCM pointers,
|
||||
c_pointers, c_extra_vars,
|
||||
c_options);
|
||||
|
||||
if (c_pointers)
|
||||
weechat_hashtable_free (c_pointers);
|
||||
if (c_extra_vars)
|
||||
weechat_hashtable_free (c_extra_vars);
|
||||
if (c_options)
|
||||
weechat_hashtable_free (c_options);
|
||||
weechat_hashtable_free (c_pointers);
|
||||
weechat_hashtable_free (c_extra_vars);
|
||||
weechat_hashtable_free (c_options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -2024,8 +2018,7 @@ weechat_guile_api_key_bind (SCM context, SCM keys)
|
||||
|
||||
num_keys = weechat_key_bind (API_SCM_TO_STRING(context), c_keys);
|
||||
|
||||
if (c_keys)
|
||||
weechat_hashtable_free (c_keys);
|
||||
weechat_hashtable_free (c_keys);
|
||||
|
||||
API_RETURN_INT(num_keys);
|
||||
}
|
||||
@@ -2679,8 +2672,7 @@ weechat_guile_api_hook_process_hashtable (SCM command, SCM options, SCM timeout,
|
||||
API_SCM_TO_STRING(function),
|
||||
API_SCM_TO_STRING(data)));
|
||||
|
||||
if (c_options)
|
||||
weechat_hashtable_free (c_options);
|
||||
weechat_hashtable_free (c_options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -2754,8 +2746,7 @@ weechat_guile_api_hook_url (SCM url, SCM options, SCM timeout,
|
||||
API_SCM_TO_STRING(function),
|
||||
API_SCM_TO_STRING(data)));
|
||||
|
||||
if (c_options)
|
||||
weechat_hashtable_free (c_options);
|
||||
weechat_hashtable_free (c_options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -3170,8 +3161,7 @@ weechat_guile_api_hook_hsignal_send (SCM signal, SCM hashtable)
|
||||
|
||||
rc = weechat_hook_hsignal_send (API_SCM_TO_STRING(signal), c_hashtable);
|
||||
|
||||
if (c_hashtable)
|
||||
weechat_hashtable_free (c_hashtable);
|
||||
weechat_hashtable_free (c_hashtable);
|
||||
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
@@ -3695,8 +3685,7 @@ weechat_guile_api_buffer_new_props (SCM name, SCM properties,
|
||||
API_SCM_TO_STRING(function_close),
|
||||
API_SCM_TO_STRING(data_close)));
|
||||
|
||||
if (c_properties)
|
||||
weechat_hashtable_free (c_properties);
|
||||
weechat_hashtable_free (c_properties);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -4504,8 +4493,7 @@ weechat_guile_api_command_options (SCM buffer, SCM command, SCM options)
|
||||
API_SCM_TO_STRING(command),
|
||||
c_options);
|
||||
|
||||
if (c_options)
|
||||
weechat_hashtable_free (c_options);
|
||||
weechat_hashtable_free (c_options);
|
||||
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
@@ -4626,10 +4614,8 @@ weechat_guile_api_info_get_hashtable (SCM info_name, SCM hash)
|
||||
c_hashtable);
|
||||
result_alist = weechat_guile_hashtable_to_alist (result_hashtable);
|
||||
|
||||
if (c_hashtable)
|
||||
weechat_hashtable_free (c_hashtable);
|
||||
if (result_hashtable)
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
weechat_hashtable_free (c_hashtable);
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
|
||||
API_RETURN_OTHER(result_alist);
|
||||
}
|
||||
@@ -5083,12 +5069,9 @@ weechat_guile_api_hdata_search (SCM hdata, SCM pointer, SCM search,
|
||||
c_options,
|
||||
scm_to_int (move)));
|
||||
|
||||
if (c_pointers)
|
||||
weechat_hashtable_free (c_pointers);
|
||||
if (c_extra_vars)
|
||||
weechat_hashtable_free (c_extra_vars);
|
||||
if (c_options)
|
||||
weechat_hashtable_free (c_options);
|
||||
weechat_hashtable_free (c_pointers);
|
||||
weechat_hashtable_free (c_extra_vars);
|
||||
weechat_hashtable_free (c_options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -5271,8 +5254,7 @@ weechat_guile_api_hdata_update (SCM hdata, SCM pointer, SCM hashtable)
|
||||
API_STR2PTR(API_SCM_TO_STRING(pointer)),
|
||||
c_hashtable);
|
||||
|
||||
if (c_hashtable)
|
||||
weechat_hashtable_free (c_hashtable);
|
||||
weechat_hashtable_free (c_hashtable);
|
||||
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
@@ -185,8 +185,7 @@ irc_batch_free (struct t_irc_server *server, struct t_irc_batch *batch)
|
||||
free (batch->parent_ref);
|
||||
free (batch->type);
|
||||
free (batch->parameters);
|
||||
if (batch->tags)
|
||||
weechat_hashtable_free (batch->tags);
|
||||
weechat_hashtable_free (batch->tags);
|
||||
if (batch->messages)
|
||||
weechat_string_dyn_free (batch->messages, 1);
|
||||
|
||||
@@ -456,8 +455,7 @@ irc_batch_process_multiline (struct t_irc_server *server,
|
||||
}
|
||||
|
||||
end:
|
||||
if (hash_tags)
|
||||
weechat_hashtable_free (hash_tags);
|
||||
weechat_hashtable_free (hash_tags);
|
||||
if (list_messages)
|
||||
weechat_string_free_split (list_messages);
|
||||
|
||||
|
||||
@@ -402,8 +402,7 @@ irc_channel_create_buffer (struct t_irc_server *server,
|
||||
}
|
||||
|
||||
end:
|
||||
if (buffer_props)
|
||||
weechat_hashtable_free (buffer_props);
|
||||
weechat_hashtable_free (buffer_props);
|
||||
free (buffer_name);
|
||||
return ptr_buffer;
|
||||
}
|
||||
@@ -1541,8 +1540,7 @@ irc_channel_free (struct t_irc_server *server, struct t_irc_channel *channel)
|
||||
free (channel->topic);
|
||||
free (channel->modes);
|
||||
free (channel->key);
|
||||
if (channel->join_msg_received)
|
||||
weechat_hashtable_free (channel->join_msg_received);
|
||||
weechat_hashtable_free (channel->join_msg_received);
|
||||
free (channel->away_message);
|
||||
free (channel->pv_remote_nick_color);
|
||||
weechat_unhook (channel->hook_autorejoin);
|
||||
@@ -1551,8 +1549,7 @@ irc_channel_free (struct t_irc_server *server, struct t_irc_channel *channel)
|
||||
if (channel->nicks_speaking[1])
|
||||
weechat_list_free (channel->nicks_speaking[1]);
|
||||
irc_channel_nick_speaking_time_free_all (channel);
|
||||
if (channel->join_smart_filtered)
|
||||
weechat_hashtable_free (channel->join_smart_filtered);
|
||||
weechat_hashtable_free (channel->join_smart_filtered);
|
||||
free (channel->buffer_as_string);
|
||||
|
||||
free (channel);
|
||||
|
||||
@@ -956,8 +956,7 @@ irc_list_create_buffer (struct t_irc_server *server)
|
||||
&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);
|
||||
|
||||
irc_list_buffer_set_localvar_filter (buffer, server);
|
||||
|
||||
|
||||
@@ -123,8 +123,7 @@ irc_raw_message_match_filter (struct t_irc_raw_message *raw_message,
|
||||
hashtable,
|
||||
irc_raw_filter_hashtable_options);
|
||||
match = (result && (strcmp (result, "1") == 0)) ? 1 : 0;
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
free (result);
|
||||
return match;
|
||||
}
|
||||
@@ -407,8 +406,7 @@ irc_raw_open (int switch_to_buffer)
|
||||
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);
|
||||
|
||||
/* failed to create buffer ? then return */
|
||||
if (!irc_raw_buffer)
|
||||
|
||||
@@ -770,8 +770,7 @@ irc_redirect_stop (struct t_irc_redirect *redirect, const char *error)
|
||||
redirect->signal, redirect->pattern);
|
||||
(void) weechat_hook_hsignal_send (signal_name, hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
irc_redirect_free (redirect);
|
||||
}
|
||||
@@ -977,14 +976,10 @@ irc_redirect_free (struct t_irc_redirect *redirect)
|
||||
free (redirect->signal);
|
||||
free (redirect->string);
|
||||
free (redirect->command);
|
||||
if (redirect->cmd_start)
|
||||
weechat_hashtable_free (redirect->cmd_start);
|
||||
if (redirect->cmd_stop)
|
||||
weechat_hashtable_free (redirect->cmd_stop);
|
||||
if (redirect->cmd_extra)
|
||||
weechat_hashtable_free (redirect->cmd_extra);
|
||||
if (redirect->cmd_filter)
|
||||
weechat_hashtable_free (redirect->cmd_filter);
|
||||
weechat_hashtable_free (redirect->cmd_start);
|
||||
weechat_hashtable_free (redirect->cmd_stop);
|
||||
weechat_hashtable_free (redirect->cmd_extra);
|
||||
weechat_hashtable_free (redirect->cmd_filter);
|
||||
free (redirect->output);
|
||||
|
||||
free (redirect);
|
||||
|
||||
@@ -473,8 +473,7 @@ irc_sasl_get_key_content (const char *sasl_key, char **sasl_error)
|
||||
if (options)
|
||||
weechat_hashtable_set (options, "directory", "config");
|
||||
key_path = weechat_string_eval_path_home (sasl_key, NULL, NULL, options);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
if (key_path)
|
||||
content = weechat_file_get_content (key_path);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -429,8 +429,7 @@ irc_tag_add_tags_to_message (const char *message, struct t_hashtable *tags)
|
||||
|
||||
end:
|
||||
free (msg_str_tags);
|
||||
if (msg_hash_tags)
|
||||
weechat_hashtable_free (msg_hash_tags);
|
||||
weechat_hashtable_free (msg_hash_tags);
|
||||
free (new_tags);
|
||||
|
||||
return (result) ? weechat_string_dyn_free (result, 0) : NULL;
|
||||
|
||||
@@ -97,10 +97,8 @@ logger_check_conditions (struct t_gui_buffer *buffer, const char *conditions)
|
||||
condition_ok = (result && (strcmp (result, "1") == 0));
|
||||
free (result);
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
return condition_ok;
|
||||
}
|
||||
@@ -137,8 +135,7 @@ logger_get_file_path ()
|
||||
weechat_hashtable_set (options, "directory", "data");
|
||||
path = weechat_string_eval_path_home (
|
||||
weechat_config_string (logger_config_file_path), NULL, NULL, options);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
if (!path)
|
||||
goto end;
|
||||
|
||||
|
||||
@@ -526,12 +526,9 @@ API_FUNC(string_eval_expression)
|
||||
result = weechat_string_eval_expression (expr, pointers, extra_vars,
|
||||
options);
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -563,12 +560,9 @@ API_FUNC(string_eval_path_home)
|
||||
result = weechat_string_eval_path_home (path, pointers, extra_vars,
|
||||
options);
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -2116,8 +2110,7 @@ API_FUNC(key_bind)
|
||||
|
||||
num_keys = weechat_key_bind (context, hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(num_keys);
|
||||
}
|
||||
@@ -2832,8 +2825,7 @@ API_FUNC(hook_process_hashtable)
|
||||
function,
|
||||
data));
|
||||
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -2908,8 +2900,7 @@ API_FUNC(hook_url)
|
||||
function,
|
||||
data));
|
||||
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -3335,8 +3326,7 @@ API_FUNC(hook_hsignal_send)
|
||||
|
||||
rc = weechat_hook_hsignal_send (signal, hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
@@ -3880,8 +3870,7 @@ API_FUNC(buffer_new_props)
|
||||
function_close,
|
||||
data_close));
|
||||
|
||||
if (properties)
|
||||
weechat_hashtable_free (properties);
|
||||
weechat_hashtable_free (properties);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -4767,8 +4756,7 @@ API_FUNC(command_options)
|
||||
command,
|
||||
options);
|
||||
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
@@ -4899,10 +4887,8 @@ API_FUNC(info_get_hashtable)
|
||||
|
||||
weechat_lua_pushhashtable (L, result_hashtable);
|
||||
|
||||
if (table)
|
||||
weechat_hashtable_free (table);
|
||||
if (result_hashtable)
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
weechat_hashtable_free (table);
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -5400,12 +5386,9 @@ API_FUNC(hdata_search)
|
||||
options,
|
||||
move));
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -5614,8 +5597,7 @@ API_FUNC(hdata_update)
|
||||
API_STR2PTR(pointer),
|
||||
hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
@@ -483,12 +483,9 @@ API_FUNC(string_eval_expression)
|
||||
result = weechat_string_eval_expression (expr, pointers, extra_vars,
|
||||
options);
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -520,12 +517,9 @@ API_FUNC(string_eval_path_home)
|
||||
result = weechat_string_eval_path_home (path, pointers, extra_vars,
|
||||
options);
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -2023,8 +2017,7 @@ API_FUNC(key_bind)
|
||||
|
||||
num_keys = weechat_key_bind (context, hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(num_keys);
|
||||
}
|
||||
@@ -2712,8 +2705,7 @@ API_FUNC(hook_process_hashtable)
|
||||
function,
|
||||
data));
|
||||
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -2787,8 +2779,7 @@ API_FUNC(hook_url)
|
||||
function,
|
||||
data));
|
||||
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -3215,8 +3206,7 @@ API_FUNC(hook_hsignal_send)
|
||||
|
||||
rc = weechat_hook_hsignal_send (signal, hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
@@ -3769,8 +3759,7 @@ API_FUNC(buffer_new_props)
|
||||
function_close,
|
||||
data_close));
|
||||
|
||||
if (properties)
|
||||
weechat_hashtable_free (properties);
|
||||
weechat_hashtable_free (properties);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -4665,8 +4654,7 @@ API_FUNC(command_options)
|
||||
API_STR2PTR(buffer),
|
||||
command,
|
||||
options);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
@@ -4799,10 +4787,8 @@ API_FUNC(info_get_hashtable)
|
||||
result_hashtable = weechat_info_get_hashtable (info_name, hashtable);
|
||||
result_hash = weechat_perl_hashtable_to_hash (result_hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
if (result_hashtable)
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
|
||||
API_RETURN_OBJ(result_hash);
|
||||
}
|
||||
@@ -5314,12 +5300,9 @@ API_FUNC(hdata_search)
|
||||
options,
|
||||
move));
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -5538,8 +5521,7 @@ API_FUNC(hdata_update)
|
||||
API_STR2PTR(pointer),
|
||||
hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
@@ -627,12 +627,9 @@ API_FUNC(string_eval_expression)
|
||||
extra_vars,
|
||||
options);
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -672,12 +669,9 @@ API_FUNC(string_eval_path_home)
|
||||
extra_vars,
|
||||
options);
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -2199,8 +2193,7 @@ API_FUNC(key_bind)
|
||||
|
||||
result = weechat_key_bind ((const char *)context, keys);
|
||||
|
||||
if (keys)
|
||||
weechat_hashtable_free (keys);
|
||||
weechat_hashtable_free (keys);
|
||||
|
||||
API_RETURN_INT(result);
|
||||
}
|
||||
@@ -2870,8 +2863,7 @@ API_FUNC(hook_process_hashtable)
|
||||
(const char *)callback_name,
|
||||
(const char *)data));
|
||||
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -2932,8 +2924,7 @@ API_FUNC(hook_url)
|
||||
(const char *)callback_name,
|
||||
(const char *)data));
|
||||
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -3261,8 +3252,7 @@ API_FUNC(hook_hsignal_send)
|
||||
|
||||
result = weechat_hook_hsignal_send ((const char *)signal, hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(result);
|
||||
}
|
||||
@@ -3741,8 +3731,7 @@ API_FUNC(buffer_new_props)
|
||||
(const char *)close_callback_name,
|
||||
(const char *)data_close));
|
||||
|
||||
if (properties)
|
||||
weechat_hashtable_free (properties);
|
||||
weechat_hashtable_free (properties);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -4737,8 +4726,7 @@ API_FUNC(command_options)
|
||||
(const char *)command,
|
||||
options);
|
||||
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_INT(result);
|
||||
}
|
||||
@@ -4886,8 +4874,7 @@ API_FUNC(info_get_hashtable)
|
||||
|
||||
result = weechat_info_get_hashtable ((const char *)info_name, hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
weechat_php_hashtable_to_array (result, return_value);
|
||||
}
|
||||
@@ -5467,12 +5454,9 @@ API_FUNC(hdata_search)
|
||||
options,
|
||||
move));
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -5704,8 +5688,7 @@ API_FUNC(hdata_update)
|
||||
|
||||
result = weechat_hdata_update (hdata, pointer, hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(result);
|
||||
}
|
||||
|
||||
@@ -544,8 +544,7 @@ plugin_api_modifier_eval_path_home_cb (const void *pointer, void *data,
|
||||
|
||||
result = string_eval_path_home (string, NULL, NULL, options);
|
||||
|
||||
if (options)
|
||||
hashtable_free (options);
|
||||
hashtable_free (options);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1087,8 +1087,7 @@ plugin_auto_load (char *force_plugin_autoload,
|
||||
hashtable_set (options, "directory", "data");
|
||||
plugin_path = string_eval_path_home (CONFIG_STRING(config_plugin_path),
|
||||
NULL, NULL, options);
|
||||
if (options)
|
||||
hashtable_free (options);
|
||||
hashtable_free (options);
|
||||
if (plugin_path)
|
||||
{
|
||||
dir_exec_on_files (plugin_path, 1, 0,
|
||||
|
||||
@@ -477,12 +477,9 @@ API_FUNC(string_eval_expression)
|
||||
WEECHAT_HASHTABLE_STRING);
|
||||
result = weechat_string_eval_expression (expr, pointers, extra_vars,
|
||||
options);
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -515,12 +512,9 @@ API_FUNC(string_eval_path_home)
|
||||
WEECHAT_HASHTABLE_STRING);
|
||||
result = weechat_string_eval_path_home (path, pointers, extra_vars,
|
||||
options);
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -2025,8 +2019,7 @@ API_FUNC(key_bind)
|
||||
|
||||
num_keys = weechat_key_bind (context, hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(num_keys);
|
||||
}
|
||||
@@ -2736,8 +2729,7 @@ API_FUNC(hook_process_hashtable)
|
||||
&weechat_python_api_hook_process_cb,
|
||||
function,
|
||||
data));
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -2814,8 +2806,7 @@ API_FUNC(hook_url)
|
||||
&weechat_python_api_hook_url_cb,
|
||||
function,
|
||||
data));
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -3243,8 +3234,7 @@ API_FUNC(hook_hsignal_send)
|
||||
|
||||
rc = weechat_hook_hsignal_send (signal, hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
@@ -3792,8 +3782,7 @@ API_FUNC(buffer_new_props)
|
||||
function_close,
|
||||
data_close));
|
||||
|
||||
if (properties)
|
||||
weechat_hashtable_free (properties);
|
||||
weechat_hashtable_free (properties);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -4654,8 +4643,7 @@ API_FUNC(command_options)
|
||||
API_STR2PTR(buffer),
|
||||
command,
|
||||
options);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
@@ -4785,10 +4773,8 @@ API_FUNC(info_get_hashtable)
|
||||
result_hashtable = weechat_info_get_hashtable (info_name, hashtable);
|
||||
result_dict = weechat_python_hashtable_to_dict (result_hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
if (result_hashtable)
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
|
||||
return result_dict;
|
||||
}
|
||||
@@ -5275,12 +5261,9 @@ API_FUNC(hdata_search)
|
||||
options,
|
||||
move));
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -5484,8 +5467,7 @@ API_FUNC(hdata_update)
|
||||
API_STR2PTR(pointer),
|
||||
hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -584,12 +584,9 @@ weechat_ruby_api_string_eval_expression (VALUE class, VALUE expr,
|
||||
result = weechat_string_eval_expression (c_expr, c_pointers, c_extra_vars,
|
||||
c_options);
|
||||
|
||||
if (c_pointers)
|
||||
weechat_hashtable_free (c_pointers);
|
||||
if (c_extra_vars)
|
||||
weechat_hashtable_free (c_extra_vars);
|
||||
if (c_options)
|
||||
weechat_hashtable_free (c_options);
|
||||
weechat_hashtable_free (c_pointers);
|
||||
weechat_hashtable_free (c_extra_vars);
|
||||
weechat_hashtable_free (c_options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -633,12 +630,9 @@ weechat_ruby_api_string_eval_path_home (VALUE class, VALUE path,
|
||||
result = weechat_string_eval_path_home (c_path, c_pointers, c_extra_vars,
|
||||
c_options);
|
||||
|
||||
if (c_pointers)
|
||||
weechat_hashtable_free (c_pointers);
|
||||
if (c_extra_vars)
|
||||
weechat_hashtable_free (c_extra_vars);
|
||||
if (c_options)
|
||||
weechat_hashtable_free (c_options);
|
||||
weechat_hashtable_free (c_pointers);
|
||||
weechat_hashtable_free (c_extra_vars);
|
||||
weechat_hashtable_free (c_options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -2504,8 +2498,7 @@ weechat_ruby_api_key_bind (VALUE class, VALUE context, VALUE keys)
|
||||
|
||||
num_keys = weechat_key_bind (c_context, c_keys);
|
||||
|
||||
if (c_keys)
|
||||
weechat_hashtable_free (c_keys);
|
||||
weechat_hashtable_free (c_keys);
|
||||
|
||||
API_RETURN_INT(num_keys);
|
||||
}
|
||||
@@ -3360,8 +3353,7 @@ weechat_ruby_api_hook_process_hashtable (VALUE class, VALUE command,
|
||||
c_function,
|
||||
c_data));
|
||||
|
||||
if (c_options)
|
||||
weechat_hashtable_free (c_options);
|
||||
weechat_hashtable_free (c_options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -3446,8 +3438,7 @@ weechat_ruby_api_hook_url (VALUE class, VALUE url,
|
||||
c_function,
|
||||
c_data));
|
||||
|
||||
if (c_options)
|
||||
weechat_hashtable_free (c_options);
|
||||
weechat_hashtable_free (c_options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -3930,8 +3921,7 @@ weechat_ruby_api_hook_hsignal_send (VALUE class, VALUE signal, VALUE hashtable)
|
||||
|
||||
rc = weechat_hook_hsignal_send (c_signal, c_hashtable);
|
||||
|
||||
if (c_hashtable)
|
||||
weechat_hashtable_free (c_hashtable);
|
||||
weechat_hashtable_free (c_hashtable);
|
||||
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
@@ -4570,8 +4560,7 @@ weechat_ruby_api_buffer_new_props (VALUE class, VALUE name, VALUE properties,
|
||||
c_function_close,
|
||||
c_data_close));
|
||||
|
||||
if (c_properties)
|
||||
weechat_hashtable_free (c_properties);
|
||||
weechat_hashtable_free (c_properties);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -5698,8 +5687,7 @@ weechat_ruby_api_command_options (VALUE class, VALUE buffer, VALUE command,
|
||||
c_command,
|
||||
c_options);
|
||||
|
||||
if (c_options)
|
||||
weechat_hashtable_free (c_options);
|
||||
weechat_hashtable_free (c_options);
|
||||
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
@@ -5868,10 +5856,8 @@ weechat_ruby_api_info_get_hashtable (VALUE class, VALUE info_name,
|
||||
result_hashtable = weechat_info_get_hashtable (c_info_name, c_hashtable);
|
||||
result_hash = weechat_ruby_hashtable_to_hash (result_hashtable);
|
||||
|
||||
if (c_hashtable)
|
||||
weechat_hashtable_free (c_hashtable);
|
||||
if (result_hashtable)
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
weechat_hashtable_free (c_hashtable);
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
|
||||
return result_hash;
|
||||
}
|
||||
@@ -6498,12 +6484,9 @@ weechat_ruby_api_hdata_search (VALUE class, VALUE hdata, VALUE pointer,
|
||||
c_options,
|
||||
c_move));
|
||||
|
||||
if (c_pointers)
|
||||
weechat_hashtable_free (c_pointers);
|
||||
if (c_extra_vars)
|
||||
weechat_hashtable_free (c_extra_vars);
|
||||
if (c_options)
|
||||
weechat_hashtable_free (c_options);
|
||||
weechat_hashtable_free (c_pointers);
|
||||
weechat_hashtable_free (c_extra_vars);
|
||||
weechat_hashtable_free (c_options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -6778,8 +6761,7 @@ weechat_ruby_api_hdata_update (VALUE class, VALUE hdata, VALUE pointer,
|
||||
API_STR2PTR(c_pointer),
|
||||
c_hashtable);
|
||||
|
||||
if (c_hashtable)
|
||||
weechat_hashtable_free (c_hashtable);
|
||||
weechat_hashtable_free (c_hashtable);
|
||||
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
@@ -1179,8 +1179,7 @@ script_buffer_open ()
|
||||
&script_buffer_input_cb, NULL, NULL,
|
||||
&script_buffer_close_cb, NULL, NULL);
|
||||
|
||||
if (buffer_props)
|
||||
weechat_hashtable_free (buffer_props);
|
||||
weechat_hashtable_free (buffer_props);
|
||||
|
||||
if (!script_buffer)
|
||||
return;
|
||||
|
||||
@@ -174,8 +174,7 @@ script_config_get_xml_filename ()
|
||||
weechat_hashtable_set (options, "directory", "cache");
|
||||
path = weechat_string_eval_path_home (
|
||||
weechat_config_string (script_config_scripts_path), NULL, NULL, options);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
length = strlen (path) + 64;
|
||||
filename = malloc (length);
|
||||
if (filename)
|
||||
@@ -208,8 +207,7 @@ script_config_get_script_download_filename (struct t_script_repo *script,
|
||||
weechat_hashtable_set (options, "directory", "cache");
|
||||
path = weechat_string_eval_path_home (
|
||||
weechat_config_string (script_config_scripts_path), NULL, NULL, options);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
length = strlen (path) + 1 + strlen (script->name_with_extension)
|
||||
+ ((suffix) ? strlen (suffix) : 0) + 1;
|
||||
filename = malloc (length);
|
||||
|
||||
@@ -1391,8 +1391,7 @@ script_repo_file_read (int quiet)
|
||||
script_repo_free (script);
|
||||
free (locale);
|
||||
free (locale_language);
|
||||
if (descriptions)
|
||||
weechat_hashtable_free (descriptions);
|
||||
weechat_hashtable_free (descriptions);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -527,12 +527,9 @@ API_FUNC(string_eval_expression)
|
||||
result = weechat_string_eval_expression (expr, pointers, extra_vars,
|
||||
options);
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -566,12 +563,9 @@ API_FUNC(string_eval_path_home)
|
||||
result = weechat_string_eval_path_home (path, pointers, extra_vars,
|
||||
options);
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
@@ -2052,8 +2046,7 @@ API_FUNC(key_bind)
|
||||
|
||||
num_keys = weechat_key_bind (context, hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(num_keys);
|
||||
}
|
||||
@@ -2786,8 +2779,7 @@ API_FUNC(hook_process_hashtable)
|
||||
function,
|
||||
data));
|
||||
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -2864,8 +2856,7 @@ API_FUNC(hook_url)
|
||||
function,
|
||||
data));
|
||||
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -3298,8 +3289,7 @@ API_FUNC(hook_hsignal_send)
|
||||
|
||||
rc = weechat_hook_hsignal_send (signal, hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
@@ -3840,8 +3830,7 @@ API_FUNC(buffer_new_props)
|
||||
function_close,
|
||||
data_close));
|
||||
|
||||
if (properties)
|
||||
weechat_hashtable_free (properties);
|
||||
weechat_hashtable_free (properties);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -4706,8 +4695,7 @@ API_FUNC(command_options)
|
||||
command,
|
||||
options);
|
||||
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
@@ -4824,10 +4812,8 @@ API_FUNC(info_get_hashtable)
|
||||
hashtable);
|
||||
result_dict = weechat_tcl_hashtable_to_dict (interp, result_hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
if (result_hashtable)
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (result_hashtable);
|
||||
|
||||
API_RETURN_OBJ(result_dict);
|
||||
}
|
||||
@@ -5298,12 +5284,9 @@ API_FUNC(hdata_search)
|
||||
options,
|
||||
move));
|
||||
|
||||
if (pointers)
|
||||
weechat_hashtable_free (pointers);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (pointers);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (options);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
@@ -5517,8 +5500,7 @@ API_FUNC(hdata_update)
|
||||
API_STR2PTR(pointer),
|
||||
hashtable);
|
||||
|
||||
if (hashtable)
|
||||
weechat_hashtable_free (hashtable);
|
||||
weechat_hashtable_free (hashtable);
|
||||
|
||||
API_RETURN_INT(value);
|
||||
}
|
||||
|
||||
@@ -227,8 +227,7 @@ trigger_buffer_open (const char *filter, int switch_to_buffer)
|
||||
buffer_props,
|
||||
&trigger_buffer_input_cb, NULL, NULL,
|
||||
&trigger_buffer_close_cb, NULL, NULL);
|
||||
if (buffer_props)
|
||||
weechat_hashtable_free (buffer_props);
|
||||
weechat_hashtable_free (buffer_props);
|
||||
}
|
||||
|
||||
/* failed to create buffer ? then return */
|
||||
|
||||
@@ -463,8 +463,7 @@ trigger_hook (struct t_trigger *trigger)
|
||||
free (eval_args);
|
||||
free (eval_desc_args);
|
||||
free (eval_completion);
|
||||
if (extra_vars)
|
||||
weechat_hashtable_free (extra_vars);
|
||||
weechat_hashtable_free (extra_vars);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -367,6 +367,5 @@ xfer_buffer_open ()
|
||||
&xfer_buffer_input_cb, NULL, NULL,
|
||||
&xfer_buffer_close_cb, NULL, NULL);
|
||||
|
||||
if (buffer_props)
|
||||
weechat_hashtable_free (buffer_props);
|
||||
weechat_hashtable_free (buffer_props);
|
||||
}
|
||||
|
||||
@@ -276,8 +276,7 @@ xfer_file_find_filename (struct t_xfer *xfer)
|
||||
path = weechat_string_eval_path_home (
|
||||
weechat_config_string (xfer_config_file_download_path),
|
||||
NULL, NULL, options);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
if (!path)
|
||||
return;
|
||||
|
||||
|
||||
@@ -186,8 +186,7 @@ xfer_create_directories ()
|
||||
free (path);
|
||||
}
|
||||
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1110,8 +1109,7 @@ xfer_add_cb (const void *pointer, void *data,
|
||||
path = weechat_string_eval_path_home (
|
||||
weechat_config_string (xfer_config_file_upload_path),
|
||||
NULL, NULL, options);
|
||||
if (options)
|
||||
weechat_hashtable_free (options);
|
||||
weechat_hashtable_free (options);
|
||||
if (!path)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
|
||||
@@ -177,6 +177,9 @@ TEST(CoreHashtable, SetGetRemove)
|
||||
unsigned long long hash;
|
||||
int i;
|
||||
|
||||
/* free hashtable with NULL pointer */
|
||||
hashtable_free (NULL);
|
||||
|
||||
hashtable = hashtable_new (32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
|
||||
Reference in New Issue
Block a user