1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 21:06:38 +02:00

plugins: remove check of NULL pointers before calling weechat_hashtable_free() (issue #865)

This commit is contained in:
Sébastien Helleu
2024-04-25 19:01:56 +02:00
parent 1ad0b4b669
commit 0b2d9bcb9b
41 changed files with 189 additions and 373 deletions
+18 -36
View File
@@ -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);
}