summaryrefslogtreecommitdiff
path: root/preproc.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-20 15:55:45 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-20 15:55:45 -0700
commit86877b294aabac1059d32611c8dce65910243454 (patch)
tree05d45febc0092fd7700a4bc309f74f8dcebb69e3 /preproc.c
parentcfb7176ca211d2bdc8c790c1b49e6f29db42f777 (diff)
downloadnasm-86877b294aabac1059d32611c8dce65910243454.tar.gz
nasm-86877b294aabac1059d32611c8dce65910243454.tar.bz2
nasm-86877b294aabac1059d32611c8dce65910243454.zip
preproc: free the include path and the final filename
Memory leaks: free the include path, and the final used filename.
Diffstat (limited to 'preproc.c')
-rw-r--r--preproc.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/preproc.c b/preproc.c
index f42c0d0..e3e79db 100644
--- a/preproc.c
+++ b/preproc.c
@@ -4151,7 +4151,7 @@ static char *pp_getline(void)
if (i->next) {
src_set_linnum(i->lineno);
nasm_free(src_set_fname(i->fname));
- }
+ }
istk = i->next;
list->downlevel(LIST_INCLUDE);
nasm_free(i);
@@ -4247,10 +4247,18 @@ static void pp_cleanup(int pass)
}
while (cstk)
ctx_pop();
+ nasm_free(src_set_fname(NULL));
if (pass == 0) {
+ IncPath *i;
free_llist(predef);
delete_Blocks();
- }
+ while ((i = ipath)) {
+ ipath = i->next;
+ if (i->path)
+ nasm_free(i->path);
+ nasm_free(i);
+ }
+ }
}
void pp_include_path(char *path)