Fix for possible memory leak and fault.

Fixed a possible memory leak and fault in AcpiExResolveObjectToValue during a read from a buffer or region field. (BZ 458)
This commit is contained in:
rmoore1 2006-09-26 17:25:05 +00:00
parent c4e6cb4356
commit ad9364590f

View File

@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exresolv - AML Interpreter object resolution * Module Name: exresolv - AML Interpreter object resolution
* $Revision: 1.139 $ * $Revision: 1.140 $
* *
*****************************************************************************/ *****************************************************************************/
@ -230,7 +230,7 @@ AcpiExResolveObjectToValue (
ACPI_STATUS Status = AE_OK; ACPI_STATUS Status = AE_OK;
ACPI_OPERAND_OBJECT *StackDesc; ACPI_OPERAND_OBJECT *StackDesc;
void *TempNode; void *TempNode;
ACPI_OPERAND_OBJECT *ObjDesc; ACPI_OPERAND_OBJECT *ObjDesc = NULL;
UINT16 Opcode; UINT16 Opcode;
@ -397,8 +397,6 @@ AcpiExResolveObjectToValue (
break; break;
/* These cases may never happen here, but just in case.. */
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
@ -408,6 +406,10 @@ AcpiExResolveObjectToValue (
StackDesc, ACPI_GET_OBJECT_TYPE (StackDesc))); StackDesc, ACPI_GET_OBJECT_TYPE (StackDesc)));
Status = AcpiExReadDataFromField (WalkState, StackDesc, &ObjDesc); Status = AcpiExReadDataFromField (WalkState, StackDesc, &ObjDesc);
/* Remove a reference to the original operand, then override */
AcpiUtRemoveReference (*StackPtr);
*StackPtr = (void *) ObjDesc; *StackPtr = (void *) ObjDesc;
break; break;