ACPICA: Fix possible memory leak in acpi_ns_get_external_pathname

Fixes a memory leak in the error exit path.

Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Lin Ming <[email protected]>
Signed-off-by: Len Brown <[email protected]>
This commit is contained in:
Bob Moore 2008-09-27 11:12:36 +08:00 • committed by Len Brown
commit 393a75d6b7

View file

@ -142,7 +142,7 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
size = acpi_ns_get_pathname_length(node);
if (!size) {
return (NULL);
return_PTR(NULL);
}
/* Allocate a buffer to be returned to caller */
@ -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);
if (ACPI_FAILURE(status)) {
return (NULL);
ACPI_FREE(name_buffer);
return_PTR(NULL);
}
return_PTR(name_buffer);