[SETUPAPI]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 24 Oct 2015 10:09:44 +0000 (10:09 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 24 Oct 2015 10:09:44 +0000 (10:09 +0000)
Fix a memory leak

CID 716468

svn path=/trunk/; revision=69671

reactos/dll/win32/setupapi/query.c

index fa9e2a7..58c3d5b 100644 (file)
@@ -356,7 +356,10 @@ static LPWSTR get_source_id( HINF hinf, PINFCONTEXT context, PCWSTR filename )
     }
 
     if (!SetupDiGetActualSectionToInstallW(hinf, source_disks_names, Section, MAX_PATH, NULL, NULL))
+    {
+        HeapFree( GetProcessHeap(), 0, source_id );
         return NULL;
+    }
 
     if (!SetupFindFirstLineW( hinf, Section, source_id, context ) &&
         !SetupFindFirstLineW( hinf, source_disks_names, source_id, context ))