diff options
author | Robert Moore <Robert.Moore@intel.com> | 2014-01-17 14:34:43 -0800 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2014-01-17 14:34:43 -0800 |
commit | ff5bf1b50392e744069013024f5f9e44c86c8770 (patch) | |
tree | a888192cdee96b221810c72339604a36bc767d16 | |
parent | 0bd944569718d7ddc8c46814fd39c0cf7941e1aa (diff) |
iASL/Preprocessor: Fix possible memory leak in macro processor.
Free buffer in error exit path. ACPICA BZ 1047.
-rw-r--r-- | source/compiler/prmacros.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/compiler/prmacros.c b/source/compiler/prmacros.c index 65282b368..6bd672749 100644 --- a/source/compiler/prmacros.c +++ b/source/compiler/prmacros.c @@ -432,7 +432,7 @@ PrAddMacro ( if (ArgCount >= PR_MAX_MACRO_ARGS) { PrError (ASL_ERROR, ASL_MSG_TOO_MANY_ARGUMENTS, TokenOffset); - return; + goto ErrorExit; } } @@ -472,7 +472,7 @@ PrAddMacro ( PrError (ASL_ERROR, ASL_MSG_TOO_MANY_ARGUMENTS, THIS_TOKEN_OFFSET (Token)); - return; + goto ErrorExit; } break; } @@ -504,7 +504,7 @@ AddMacroToList: THIS_TOKEN_OFFSET (Name)); } - return; + goto ErrorExit; } DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID @@ -523,6 +523,13 @@ AddMacroToList: DefineInfo->Args = Args; DefineInfo->ArgCount = ArgCount; } + + return; + + +ErrorExit: + ACPI_FREE (Args); + return; } |