https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bd5fb32b798378df05799…
commit bd5fb32b798378df05799b9106858086b219cf42
Author: Bișoc George <fraizeraust99(a)gmail.com>
AuthorDate: Sat Mar 30 14:48:44 2019 +0100
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Mar 31 20:09:42 2019 +0200
[COVERITY][SPOOLSS] Fix a resource leak
Unload the library pointed by hWinspool when the function fails.
CID 1401149
---
win32ss/printing/base/spoolss/main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/win32ss/printing/base/spoolss/main.c b/win32ss/printing/base/spoolss/main.c
index c7b3f63561..985ac1554c 100644
--- a/win32ss/printing/base/spoolss/main.c
+++ b/win32ss/printing/base/spoolss/main.c
@@ -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;
}