[spice-streaming-agent PATCH 2/2] LoadPlugin: call dlclose upon failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Uri Lublin <uril@xxxxxxxxxx>
---
 src/concrete-agent.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/concrete-agent.cpp b/src/concrete-agent.cpp
index ca666d7..f26b23c 100644
--- a/src/concrete-agent.cpp
+++ b/src/concrete-agent.cpp
@@ -80,6 +80,7 @@ void ConcreteAgent::LoadPlugin(const std::string &plugin_filename)
     if (!dl) {
         syslog(LOG_ERR, "error loading plugin %s: %s",
                plugin_filename.c_str(), dlerror());
+        dlclose(dl);
         return;
     }
 
@@ -88,6 +89,7 @@ void ConcreteAgent::LoadPlugin(const std::string &plugin_filename)
     if (!version) {
         syslog(LOG_ERR, "error loading plugin %s: no version information",
                plugin_filename.c_str());
+        dlclose(dl);
         return;
     }
     if (!PluginVersionIsCompatible(*version)) {
@@ -95,6 +97,7 @@ void ConcreteAgent::LoadPlugin(const std::string &plugin_filename)
                "error loading plugin %s: plugin interface version %u.%u not accepted",
                plugin_filename.c_str(),
                MajorVersion(*version), MinorVersion(*version));
+        dlclose(dl);
         return;
     }
 
-- 
2.17.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]