[PATCH] odbccp32: Fix memory leak in SQLGetInstalledDrivers() (Coverity).

Józef Kucia jkucia at codeweavers.com
Mon May 28 04:38:42 CDT 2018


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/odbccp32/odbccp32.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c
index 862237c67768..f54674c32f1a 100644
--- a/dlls/odbccp32/odbccp32.c
+++ b/dlls/odbccp32/odbccp32.c
@@ -572,7 +572,10 @@ BOOL WINAPI SQLGetInstalledDrivers(char *buf, WORD size, WORD *sizeout)
 
     ret = SQLGetInstalledDriversW(wbuf, size, &written);
     if (!ret)
+    {
+        heap_free(wbuf);
         return FALSE;
+    }
 
     *sizeout = WideCharToMultiByte(CP_ACP, 0, wbuf, written, NULL, 0, NULL, NULL);
     WideCharToMultiByte(CP_ACP, 0, wbuf, written, buf, size, NULL, NULL);
-- 
2.16.1




More information about the wine-devel mailing list