Skip to content

Commit

Permalink
ACPICA: Fix possible memory leak in acpi_ns_get_external_pathname
Browse files Browse the repository at this point in the history
Fixes a memory leak in the error exit path.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Bob Moore authored and Len Brown committed Oct 23, 2008
1 parent 1044f1f commit 393a75d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/acpi/namespace/nsnames.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
Expand Down

0 comments on commit 393a75d

Please sign in to comment.