Commit 85022e50 authored by Lionel Debroux's avatar Lionel Debroux Committed by Alexandre Julliard

setupapi: Fix memory leak (found by Smatch).

parent 5ac6e1f5
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment