[Nasm-bugs] [Bug 3392896] New: Potential memory leak issues regarding the variables 'depend_file' and 'depend_target' in asm/nasm.c

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Sun Jul 30 19:47:51 PDT 2023


https://bugzilla.nasm.us/show_bug.cgi?id=3392896

            Bug ID: 3392896
           Summary: Potential memory leak issues regarding the variables
                    'depend_file' and 'depend_target' in asm/nasm.c
           Product: NASM
           Version: 2.17 (development)
          Hardware: PC
                OS: Linux
            Status: OPEN
          Severity: minor
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: zhangyy0721 at smail.nju.edu.cn
                CC: chang.seok.bae at intel.com, gorcunov at gmail.com,
                    hpa at zytor.com, nasm-bugs at nasm.us
     Obtained from: Built from git using configure

Through our tool's analysis, we may have discovered  several potential memory
leaks in asm/nasm.c

At line 598 in asm/nasm.c, 'depend_file' is allocted memory through the
'filename_set_extension' function using nasm_malloc, but this memory is not
released when the program ends, potentially leading to a memory leak.

Similarly, at line 617 in asm/nasm.c, 'depend_target' is allocated memory
through the 'quote_for_make' function using nasm_malloc, but it is not freed as
well.

Is it appropriate to free the memory of these two variables before the main
function ends?

Git master branch, a916e4127b2eaa3bf40bddf3de9b0ceefc0d98a4

-- 
You are receiving this mail because:
You are watching all bug changes.
You are on the CC list for the bug.


More information about the Nasm-bugs mailing list