Commit 393a75d6 authored by Bob Moore's avatar Bob Moore Committed by Len Brown

ACPICA: Fix possible memory leak in acpi_ns_get_external_pathname

Fixes a memory leak in the error exit path.
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 1044f1f6
...@@ -142,7 +142,7 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node) ...@@ -142,7 +142,7 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
size = acpi_ns_get_pathname_length(node); size = acpi_ns_get_pathname_length(node);
if (!size) { if (!size) {
return (NULL); return_PTR(NULL);
} }
/* Allocate a buffer to be returned to caller */ /* Allocate a buffer to be returned to caller */
...@@ -157,7 +157,8 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node) ...@@ -157,7 +157,8 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
status = acpi_ns_build_external_path(node, size, name_buffer); status = acpi_ns_build_external_path(node, size, name_buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return (NULL); ACPI_FREE(name_buffer);
return_PTR(NULL);
} }
return_PTR(name_buffer); return_PTR(name_buffer);
......
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