From 2aef6455e7fbf860f75788fa6f2b85c15f325b5f Mon Sep 17 00:00:00 2001 From: Karol Pawlowski Date: Wed, 24 Apr 2013 13:32:50 +0200 Subject: [PATCH] Fixing issues found by prevent2 (49866) [Issue#] LINUXWRT-234 [Bug] Dereference null return value [Cause] N/A [Solution] Remove issues [Verification] Build wrt-installer repository run: wrt-installer -p additionally you can run wrt-installer-tests-general --output=text --regexp='pluginFilesAdded' to run tests you should build repository with flag --define="WITH_TESTS ON" Change-Id: I62db6e501f17170b9f2a799fa596971212d47843 --- src/jobs/plugin_install/plugin_install_task.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jobs/plugin_install/plugin_install_task.cpp b/src/jobs/plugin_install/plugin_install_task.cpp index 4c87f62..65333ba 100644 --- a/src/jobs/plugin_install/plugin_install_task.cpp +++ b/src/jobs/plugin_install/plugin_install_task.cpp @@ -187,9 +187,10 @@ void PluginInstallTask::stepLoadPluginLibrary() void *dlHandle = dlopen(filename.c_str(), RTLD_LAZY); if (dlHandle == NULL) { + const char* error = (const char*)dlerror(); LogError( "Failed to load plugin: " << filename << - ". Reason: " << (dlerror() != NULL ? dlerror() : "unknown")); + ". Reason: " << (error != NULL ? error : "unknown")); ThrowMsg(Exceptions::PluginLibraryError, "Library error"); } -- 2.7.4