=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: odbccp32: Fix memory leak in SQLGetInstalledDrivers() (Coverity).

Alexandre Julliard julliard at winehq.org
Mon May 28 16:07:31 CDT 2018


Module: wine
Branch: master
Commit: e034ba1b591a2b843b902055a51da50c4371cea1
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e034ba1b591a2b843b902055a51da50c4371cea1

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon May 28 11:38:42 2018 +0200

odbccp32: Fix memory leak in SQLGetInstalledDrivers() (Coverity).

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/odbccp32/odbccp32.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c
index 862237c..f54674c 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);




More information about the wine-cvs mailing list