From 395985f81533417d74e1168ac7ea7a9a84c81d21 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 17 Nov 2023 22:24:52 +0000 Subject: [PATCH] pluginmgr: fix double use of dlerror() --- src/plugins/PluginSystem.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/PluginSystem.cpp b/src/plugins/PluginSystem.cpp index 07dd226c..1468cb79 100644 --- a/src/plugins/PluginSystem.cpp +++ b/src/plugins/PluginSystem.cpp @@ -25,8 +25,9 @@ CPlugin* CPluginSystem::loadPlugin(const std::string& path) { HANDLE MODULE = dlopen(path.c_str(), RTLD_LAZY); if (!MODULE) { - m_szLastError = std::format("Plugin {} could not be loaded: {}", path, dlerror()); - Debug::log(ERR, " [PluginSystem] Plugin {} could not be loaded: {}", path, dlerror()); + std::string strerr = dlerror(); + m_szLastError = std::format("Plugin {} could not be loaded: {}", path, strerr); + Debug::log(ERR, " [PluginSystem] Plugin {} could not be loaded: {}", path, strerr); m_vLoadedPlugins.pop_back(); return nullptr; }