From 12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 15 Oct 2022 09:08:09 -0400 Subject: move buflib_free invalid handle check to the function allow buflib_free to check for invalid or already freed handles within the function -- remove all the invalid handle guards thru core_free Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e --- apps/plugin.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'apps/plugin.c') diff --git a/apps/plugin.c b/apps/plugin.c index 888a9e109c..4016040c5a 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -839,8 +839,7 @@ int plugin_load(const char* plugin, const void* parameter) } lc_close(current_plugin_handle); current_plugin_handle = pfn_tsr_exit = NULL; - if (plugin_buffer_handle > 0) - plugin_buffer_handle = core_free(plugin_buffer_handle); + plugin_buffer_handle = core_free(plugin_buffer_handle); } splash(0, ID2P(LANG_WAIT)); @@ -921,8 +920,7 @@ int plugin_load(const char* plugin, const void* parameter) { /* close handle if plugin is no tsr one */ lc_close(current_plugin_handle); current_plugin_handle = NULL; - if (plugin_buffer_handle > 0) - plugin_buffer_handle = core_free(plugin_buffer_handle); + plugin_buffer_handle = core_free(plugin_buffer_handle); } talk_buffer_set_policy(TALK_BUFFER_DEFAULT); -- cgit v1.2.3