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

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2018-05-28 11:38:42 +02:00 committed by Alexandre Julliard
parent 7d99d74572
commit e034ba1b59
1 changed files with 3 additions and 0 deletions

View File

@ -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);