From e034ba1b591a2b843b902055a51da50c4371cea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 28 May 2018 11:38:42 +0200 Subject: [PATCH] odbccp32: Fix memory leak in SQLGetInstalledDrivers() (Coverity). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Alexandre Julliard --- dlls/odbccp32/odbccp32.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c index 862237c6776..f54674c32f1 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);