From 3c600cfb6cb4e8670da32bd483a1917988d2956b Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 9 May 2002 21:13:37 +0000 Subject: [PATCH] Fix acpi_avoid() to call freeenv() on the original char * returned from getenv(). Reported by: joe Tested by: joe --- sys/dev/acpica/acpi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 90c712449560..b591ae87cf86 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1556,16 +1556,17 @@ acpi_name(ACPI_HANDLE handle) int acpi_avoid(ACPI_HANDLE handle) { - char *cp, *np; + char *cp, *env, *np; int len; np = acpi_name(handle); if (*np == '\\') np++; - if ((cp = getenv("debug.acpi.avoid")) == NULL) + if ((env = getenv("debug.acpi.avoid")) == NULL) return(0); /* scan the avoid list checking for a match */ + cp = env; for (;;) { while ((*cp != 0) && isspace(*cp)) cp++; @@ -1575,12 +1576,12 @@ acpi_avoid(ACPI_HANDLE handle) while ((cp[len] != 0) && !isspace(cp[len])) len++; if (!strncmp(cp, np, len)) { - freeenv(cp); + freeenv(env); return(1); } cp += len; } - freeenv(cp); + freeenv(env); return(0); }