From 85022e50c28a6843e0e62c34509831929792af10 Mon Sep 17 00:00:00 2001 From: Lionel Debroux Date: Fri, 31 Aug 2007 14:16:56 +0200 Subject: [PATCH] setupapi: Fix memory leak (found by Smatch). --- dlls/setupapi/query.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/setupapi/query.c b/dlls/setupapi/query.c index 04b9c4dd58b..68193d72600 100644 --- a/dlls/setupapi/query.c +++ b/dlls/setupapi/query.c @@ -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; }