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>
This commit is contained in:
Cyrill Gorcunov 2020-10-04 23:45:04 +03:00
parent 858bc9d6b9
commit 78f14ab1a6

View file

@ -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);
}
}