mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 04:16:38 +02:00
plugins: remove check of NULL pointers before calling weechat_hashtable_free() (issue #865)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user