From b502a802f4aad87211476d126544d6c1d9cee7e6 Mon Sep 17 00:00:00 2001 From: siavashserver Date: Thu, 8 Mar 2018 09:13:36 +0330 Subject: [PATCH] Fix memory leak upon ProcessDeferred failure. --- glslang/MachineIndependent/ShaderLang.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/glslang/MachineIndependent/ShaderLang.cpp b/glslang/MachineIndependent/ShaderLang.cpp index 7525396b..44607523 100644 --- a/glslang/MachineIndependent/ShaderLang.cpp +++ b/glslang/MachineIndependent/ShaderLang.cpp @@ -840,8 +840,13 @@ bool ProcessDeferred( // Add built-in symbols that are potentially context dependent; // they get popped again further down. if (! AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spvVersion, - stage, source)) + stage, source)) { + delete symbolTableMemory; + delete [] lengths; + delete [] strings; + delete [] names; return false; + } // // Now we can process the full shader under proper symbols and rules.