Commit 583061c5 authored by Lin Ming's avatar Lin Ming Committed by Len Brown

ACPICA: Fix possible memory leak for module-level code execution

An object can be leaked for each block of executed module-level
code if the interpreter slack mode is enabled. The change deletes
any implicitly returned object in this case.
Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent b00eb796
......@@ -415,6 +415,12 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj,
ACPI_DEBUG_PRINT((ACPI_DB_INIT, "Executed module-level code at %p\n",
method_obj->method.aml_start));
/* Delete a possible implicit return value (in slack mode) */
if (info->return_object) {
acpi_ut_remove_reference(info->return_object);
}
/* Detach the temporary method object */
acpi_ns_detach_object(parent_node);
......
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