Added check for NULL hModule to DLClose
authorVictor Kirhenshtein <victor@netxms.org>
Thu, 15 Sep 2005 20:56:16 +0000 (20:56 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Thu, 15 Sep 2005 20:56:16 +0000 (20:56 +0000)
src/libnetxms/dload.cpp

index 7ad2a2a..6e0203f 100644 (file)
@@ -55,11 +55,14 @@ HMODULE LIBNETXMS_EXPORTABLE DLOpen(TCHAR *szLibName, TCHAR *pszErrorText)
 
 void LIBNETXMS_EXPORTABLE DLClose(HMODULE hModule)
 {
+   if (hModule != NULL)
+   {
 #ifdef _WIN32
-   FreeLibrary(hModule);
+      FreeLibrary(hModule);
 #else    /* _WIN32 */
-   dlclose(hModule);
+      dlclose(hModule);
 #endif
+   }
 }