setupapi: Fix memory leak (found by Smatch).

This commit is contained in:
Lionel Debroux 2007-08-31 14:16:56 +02:00 committed by Alexandre Julliard
parent 5ac6e1f5c5
commit 85022e50c2

View file

@ -241,6 +241,7 @@ BOOL WINAPI SetupQueryInfFileInformationA(PSP_INF_INFORMATION InfInformation,
if (!ReturnBuffer)
{
HeapFree(GetProcessHeap(), 0, filenameW);
if (ReturnBufferSize)
{
SetLastError(ERROR_INVALID_PARAMETER);
@ -252,6 +253,7 @@ BOOL WINAPI SetupQueryInfFileInformationA(PSP_INF_INFORMATION InfInformation,
if (size > ReturnBufferSize)
{
HeapFree(GetProcessHeap(), 0, filenameW);
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return FALSE;
}