aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2020-10-04 23:45:04 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2020-10-04 23:45:04 +0300
commit78f14ab1a63963fd302ce7ecc48b6a9df5442675 (patch)
tree3ba3f788fb0c8a5bbb231a9f680e1bd056bca3f8
parent858bc9d6b9d8d77961a375e792e69666d613383f (diff)
downloadnasm-78f14ab1a63963fd302ce7ecc48b6a9df5442675.tar.gz
nasm-78f14ab1a63963fd302ce7ecc48b6a9df5442675.tar.xz
nasm-78f14ab1a63963fd302ce7ecc48b6a9df5442675.zip
outmacho.c: macho_dbg_linenum - fix memory leak
If new list is not needed then we should free memory allocated by nasm_basename and nasm_dirname calls. CID 1432930 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--output/outmacho.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/output/outmacho.c b/output/outmacho.c
index 7ec3e752..53c6fa73 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -2139,6 +2139,9 @@ static void macho_dbg_linenum(const char *file_name, int32_t line_num, int32_t s
if(need_new_list) {
new_file_list(cur_file, cur_dir);
+ } else {
+ nasm_free((void *)cur_file);
+ nasm_free((void *)cur_dir);
}
}