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)
|
if (!lib->handle)
|
||||||
{
|
{
|
||||||
std::string error = dlerror()
|
const char *dlerr = dlerror();
|
||||||
? dlerror()
|
|
||||||
: "Unknown error while opening shlib";
|
std::string error = (dlerr
|
||||||
|
? dlerr
|
||||||
|
: "Unknown error while opening shlib");
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
std::string(__func__) + " - Cannot load library '"
|
std::string(__func__) + ": Cannot load library '"
|
||||||
+ libraryPath + "': "
|
+ libraryPath + "': "
|
||||||
+ error);
|
+ error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user