From: Bob Moore Date: Sat, 27 Sep 2008 03:12:36 +0000 (+0800) Subject: ACPICA: Fix possible memory leak in acpi_ns_get_external_pathname X-Git-Tag: v2.6.28-rc1~26^2~26^2~10 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=393a75d6b7bae59221b2122634eb4cb905e84208;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Lin Ming Signed-off-by: Len Brown --- diff --git a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c index bd577387800..9c587bdfe3f 100644 --- a/drivers/acpi/namespace/nsnames.c +++ b/drivers/acpi/namespace/nsnames.c @@ -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);