From 0560138e667ce4f9d592cc8eaf037219fb7e8f0e Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 20 Feb 2019 16:40:13 -0500 Subject: [PATCH] Fixup leak of TString In decomposeIntrinsic a new TString was being allocated and passed into a TVariable. That string was leaking. This CL converts the new TString to call NewPoolTString to allocate from the TString pool. --- hlsl/hlslParseHelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index c313372..213f236 100644 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -4607,7 +4607,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& if (nullptr == symbol) { type.getQualifier().builtIn = builtin; - TVariable* variable = new TVariable(new TString(name), type); + TVariable* variable = new TVariable(NewPoolTString(name), type); symbolTable.insert(*variable); -- 2.7.4