mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Don't lose dlerror() message.
Some weird systems seem to use dl functions while doing std::string concatenation... Thanks to Hoss for reporting it
This commit is contained in:
@@ -1168,7 +1168,9 @@ ModHandle CModules::OpenModule(const CString& sModule, const CString& sModPath,
|
||||
ModHandle p = dlopen((sModPath).c_str(), RTLD_NOW | RTLD_GLOBAL);
|
||||
|
||||
if (!p) {
|
||||
sRetMsg = "Unable to open module [" + sModule + "] [" + dlerror() + "]";
|
||||
// dlerror() returns pointer to static buffer, which may be overwritten very soon with another dl call
|
||||
CString sDlError = dlerror();
|
||||
sRetMsg = "Unable to open module [" + sModule + "] [" + sDlError + "]";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user