diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-06-20 15:55:45 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-06-20 15:55:45 -0700 |
commit | 86877b294aabac1059d32611c8dce65910243454 (patch) | |
tree | 05d45febc0092fd7700a4bc309f74f8dcebb69e3 /preproc.c | |
parent | cfb7176ca211d2bdc8c790c1b49e6f29db42f777 (diff) | |
download | nasm-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.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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) |