summaryrefslogtreecommitdiff
path: root/source/compiler/aslfiles.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2014-09-11 21:38:09 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2014-09-11 21:38:09 +0000
commit754171ae60abbbd707ed8d449f07ef38f596bd22 (patch)
tree67d2b76905535d056ba6911186285d0325dc703f /source/compiler/aslfiles.c
parente599b42ef5047e5546af949d87d2cfd2e17062b0 (diff)
Notes
Diffstat (limited to 'source/compiler/aslfiles.c')
-rw-r--r--source/compiler/aslfiles.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/compiler/aslfiles.c b/source/compiler/aslfiles.c
index 514c119d6b49..722e0ee9b620 100644
--- a/source/compiler/aslfiles.c
+++ b/source/compiler/aslfiles.c
@@ -107,6 +107,8 @@ FlSetFilename (
DbgPrint (ASL_PARSE_OUTPUT, "\n#line: New filename %s (old %s)\n",
Filename, Gbl_Files[ASL_FILE_INPUT].Filename);
+ /* No need to free any existing filename */
+
Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
}
@@ -216,14 +218,14 @@ FlMergePathnames (
(*FilePathname == '/') ||
(FilePathname[1] == ':'))
{
- Pathname = ACPI_ALLOCATE (strlen (FilePathname) + 1);
+ Pathname = UtStringCacheCalloc (strlen (FilePathname) + 1);
strcpy (Pathname, FilePathname);
goto ConvertBackslashes;
}
/* Need a local copy of the prefix directory path */
- CommonPath = ACPI_ALLOCATE (strlen (PrefixDir) + 1);
+ CommonPath = UtStringCacheCalloc (strlen (PrefixDir) + 1);
strcpy (CommonPath, PrefixDir);
/*
@@ -259,14 +261,13 @@ FlMergePathnames (
/* Build the final merged pathname */
ConcatenatePaths:
- Pathname = ACPI_ALLOCATE_ZEROED (strlen (CommonPath) + strlen (FilePathname) + 2);
+ Pathname = UtStringCacheCalloc (strlen (CommonPath) + strlen (FilePathname) + 2);
if (LastElement && *CommonPath)
{
strcpy (Pathname, CommonPath);
strcat (Pathname, "/");
}
strcat (Pathname, FilePathname);
- ACPI_FREE (CommonPath);
/* Convert all backslashes to normal slashes */