Browse Source

ACPICA: Namespace: fix memory leak from building prefixed pathname

ACPICA commit f8ca5db30605467b851f86d152079631c27eeca8

Link: https://github.com/acpica/acpica/commit/f8ca5db3
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Erik Schmauss 7 years ago
parent
commit
dea4e83358
1 changed files with 4 additions and 1 deletions
  1. 4 1
      drivers/acpi/acpica/nsnames.c

+ 4 - 1
drivers/acpi/acpica/nsnames.c

@@ -377,7 +377,7 @@ char *acpi_ns_build_prefixed_pathname(union acpi_generic_state *prefix_scope,
 {
 	acpi_status status;
 	char *full_path = NULL;
-	char *external_path;
+	char *external_path = NULL;
 	char *prefix_path = NULL;
 	u32 prefix_path_length = 0;
 
@@ -423,6 +423,9 @@ cleanup:
 	if (prefix_path) {
 		ACPI_FREE(prefix_path);
 	}
+	if (external_path) {
+		ACPI_FREE(external_path);
+	}
 
 	return (full_path);
 }