Fix NULL ptr use from dlerror()
This commit is contained in:
@@ -65,11 +65,13 @@ SenseApiLib& SenseApiManager::loadSenseApiLib(const std::string& libraryPath)
|
||||
|
||||
if (!lib->handle)
|
||||
{
|
||||
std::string error = dlerror()
|
||||
? dlerror()
|
||||
: "Unknown error while opening shlib";
|
||||
const char *dlerr = dlerror();
|
||||
|
||||
std::string error = (dlerr
|
||||
? dlerr
|
||||
: "Unknown error while opening shlib");
|
||||
throw std::runtime_error(
|
||||
std::string(__func__) + " - Cannot load library '"
|
||||
std::string(__func__) + ": Cannot load library '"
|
||||
+ libraryPath + "': "
|
||||
+ error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user