Skip to content

Commit 073d860

Browse files
dmpotsGreg Roth
authored andcommitted
[bug] Fix memory leak in dxil validator (#4966)
We would create the dxil runtime reflection object but never free it. Using a unique_ptr here does the job. Found by running external tests with appverifier enabled. (cherry picked from commit 661f7ce)
1 parent 87fc5b5 commit 073d860

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/HLSL/DxilValidation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5563,7 +5563,7 @@ static void VerifyRDATMatches(_In_ ValidationContext &ValCtx,
55635563
VerifyBlobPartMatches(ValCtx, PartName, pWriter.get(), pRDATData, RDATSize);
55645564

55655565
// Verify no errors when runtime reflection from RDAT:
5566-
RDAT::DxilRuntimeReflection *pReflection = RDAT::CreateDxilRuntimeReflection();
5566+
unique_ptr<RDAT::DxilRuntimeReflection> pReflection(RDAT::CreateDxilRuntimeReflection());
55675567
if (!pReflection->InitFromRDAT(pRDATData, RDATSize)) {
55685568
ValCtx.EmitFormatError(ValidationRule::ContainerPartMatches, { PartName });
55695569
return;

0 commit comments

Comments
 (0)