]> git.stg.codes - stg.git/blobdiff - projects/stargazer/store_loader.cpp
Various fixes of issues reported by static analyzers.
[stg.git] / projects / stargazer / store_loader.cpp
index c54bdb361cc2e0b0dfb9884ce1f080dcfa873fc3..1529a2ccd7c5fb744bff2de7e95fead20a75aafd 100644 (file)
@@ -79,7 +79,7 @@ if (!handle)
 isLoaded = true;
 
 STORE * (*GetStore)();
-GetStore = (STORE * (*)())dlsym(handle, "GetStore");
+GetStore = reinterpret_cast<STORE * (*)()>(dlsym(handle, "GetStore"));
 if (!GetStore)
     {
     errorStr = std::string("GetStore() not found! ") + dlerror();
@@ -115,6 +115,8 @@ if (!isLoaded)
     return true;
     }
 
+delete plugin;
+
 if (dlclose(handle))
     {
     errorStr = "Failed to unload plugin '";