Memory associated with allTokens is never freed due to early return in "case -1"…

Memory associated with allTokens is never freed due to early return in "case -1" in CPPpragma(yystypepp*) in cpp.c ISSUE=328 Signed-off-by: Daniel Koch Author: David Kilzer git-svn-id: https://angleproject.googlecode.com/svn/trunk@1072 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent b45306b7
#define MAJOR_VERSION 1 #define MAJOR_VERSION 1
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 1070 #define BUILD_REVISION 1072
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -679,7 +679,7 @@ static int CPPpragma(yystypepp * yylvalpp) ...@@ -679,7 +679,7 @@ static int CPPpragma(yystypepp * yylvalpp)
case -1: case -1:
// EOF // EOF
CPPShInfoLogMsg("#pragma directive must end with a newline"); CPPShInfoLogMsg("#pragma directive must end with a newline");
return token; goto freeMemoryAndReturnToken;
default: default:
SrcStrName[0] = token; SrcStrName[0] = token;
SrcStrName[1] = '\0'; SrcStrName[1] = '\0';
...@@ -691,6 +691,7 @@ static int CPPpragma(yystypepp * yylvalpp) ...@@ -691,6 +691,7 @@ static int CPPpragma(yystypepp * yylvalpp)
HandlePragma((const char**)allTokens, tokenCount); HandlePragma((const char**)allTokens, tokenCount);
freeMemoryAndReturnToken:
for (i = 0; i < tokenCount; ++i) { for (i = 0; i < tokenCount; ++i) {
free (allTokens[i]); free (allTokens[i]);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment