diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2009-11-06 11:42:11 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2009-11-06 22:00:49 +0300 |
commit | 24f9398a6f66eb395341e420cd4dc14da7d9d40d (patch) | |
tree | b2e091e4c455028507501cd0e834dfc3b4f4ea67 /output | |
parent | b9771908b6674eeb06dfbe396ec1f701f7779fad (diff) | |
download | nasm-24f9398a6f66eb395341e420cd4dc14da7d9d40d.tar.gz nasm-24f9398a6f66eb395341e420cd4dc14da7d9d40d.tar.bz2 nasm-24f9398a6f66eb395341e420cd4dc14da7d9d40d.zip |
output/outelf64.c: simplify stabs64_cleanup, dwarf64_cleanup
nasm_free is failsafe against NULL passed
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'output')
-rw-r--r-- | output/outelf64.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/output/outelf64.c b/output/outelf64.c index 34fda6b..0e1fb9f 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -1856,12 +1856,9 @@ static void stabs64_cleanup(void) ptr = ptr->next; nasm_free(del); } - if (stabbuf) - nasm_free(stabbuf); - if (stabrelbuf) - nasm_free(stabrelbuf); - if (stabstrbuf) - nasm_free(stabstrbuf); + nasm_free(stabbuf); + nasm_free(stabrelbuf); + nasm_free(stabstrbuf); } /* dwarf routines */ static void dwarf64_init(void) @@ -2180,26 +2177,16 @@ static void dwarf64_generate(void) static void dwarf64_cleanup(void) { - if (arangesbuf) - nasm_free(arangesbuf); - if (arangesrelbuf) - nasm_free(arangesrelbuf); - if (pubnamesbuf) - nasm_free(pubnamesbuf); - if (infobuf) - nasm_free(infobuf); - if (inforelbuf) - nasm_free(inforelbuf); - if (abbrevbuf) - nasm_free(abbrevbuf); - if (linebuf) - nasm_free(linebuf); - if (linerelbuf) - nasm_free(linerelbuf); - if (framebuf) - nasm_free(framebuf); - if (locbuf) - nasm_free(locbuf); + nasm_free(arangesbuf); + nasm_free(arangesrelbuf); + nasm_free(pubnamesbuf); + nasm_free(infobuf); + nasm_free(inforelbuf); + nasm_free(abbrevbuf); + nasm_free(linebuf); + nasm_free(linerelbuf); + nasm_free(framebuf); + nasm_free(locbuf); } static void dwarf64_findfile(const char * fname) { |