From e1e21423648e2d640570213d0644eaae49385861 Mon Sep 17 00:00:00 2001 From: mtoler Date: Fri, 14 Aug 2026 23:08:36 -0400 Subject: [PATCH] Fix a bug where add_plugin uses a pointer to a freed string data. --- src/fmod_cache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fmod_cache.cpp b/src/fmod_cache.cpp index bc874b5c..e8f49a68 100644 --- a/src/fmod_cache.cpp +++ b/src/fmod_cache.cpp @@ -80,11 +80,11 @@ Ref FmodCache::get_bank(const String& bankPath) { uint32_t FmodCache::add_plugin(const String& p_plugin_path, uint32_t p_priority) { uint32_t handle; #if defined(ANDROID_ENABLED) && !defined(TOOLS_ENABLED) - const char* plugin_path = p_plugin_path.utf8().get_data(); + const CharString plugin_path_utf8 = p_plugin_path.utf8(); #else - const char* plugin_path = ProjectSettings::get_singleton()->globalize_path(p_plugin_path).utf8().get_data(); + const CharString plugin_path_utf8 = ProjectSettings::get_singleton()->globalize_path(p_plugin_path).utf8(); #endif - ERROR_CHECK(core_system->loadPlugin(plugin_path, &handle, p_priority)); + ERROR_CHECK(core_system->loadPlugin(plugin_path_utf8.get_data(), &handle, p_priority)); plugin_handles.append(handle); return handle; }