summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-05-09 21:13:37 +0000
committerjhb <jhb@FreeBSD.org>2002-05-09 21:13:37 +0000
commitaa67917bb40d303434d7fa59ac67d1d1bbbe452b (patch)
tree90512cab70fd84a952cfe17d71b905812dc1d697 /sys
parente93c0067368c382e5fc30434061a750fde63e530 (diff)
downloadFreeBSD-src-aa67917bb40d303434d7fa59ac67d1d1bbbe452b.zip
FreeBSD-src-aa67917bb40d303434d7fa59ac67d1d1bbbe452b.tar.gz
Fix acpi_avoid() to call freeenv() on the original char * returned from
getenv(). Reported by: joe Tested by: joe
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/acpica/acpi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 90c7124..b591ae8 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);
}
OpenPOWER on IntegriCloud