[COVERITY][SPOOLSS] Fix a resource leak
authorBișoc George <fraizeraust99@gmail.com>
Sat, 30 Mar 2019 13:48:44 +0000 (14:48 +0100)
committerHermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Sun, 31 Mar 2019 18:09:42 +0000 (20:09 +0200)
Unload the library pointed by hWinspool when the function fails.

CID 1401149

win32ss/printing/base/spoolss/main.c

index c7b3f63..985ac15 100644 (file)
@@ -227,8 +227,13 @@ SplInitializeWinSpoolDrv(PVOID* pTable)
 
     // Verify that all calls succeeded.
     for (i = 0; i < 9; i++)
+    {
         if (!pTable[i])
+        {
+            FreeLibrary(hWinspool);
             return FALSE;
+        }
+    }
 
     return TRUE;
 }