[Nasm-bugs] [Bug 3392800] New: memory leak in asm/nasm.c:610

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Mon Jul 4 02:21:58 PDT 2022


            Bug ID: 3392800
           Summary: memory leak in asm/nasm.c:610
           Product: NASM
           Version: 2.16 (development)
          Hardware: All
                OS: All
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: 13579and24680 at gmail.com
                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

$ ./nasm myinput/test1  
myinput/test1: warning: default output file same as input, using `nasm.out' for
nasm: fatal: unable to open input file `myinput/test1' No such file or

==14512==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 14 byte(s) in 1 object(s) allocated from:
    #0 0x7f10ccd7a808 in __interceptor_malloc
    #1 0x559a339ff044 in nasm_malloc nasmlib/alloc.c:55

SUMMARY: AddressSanitizer: 14 byte(s) leaked in 1 allocation(s).

Analysis :

When the first argument of nasm is a pathname without '.', forget to free
outname before set `outname = "nasm.out";`. (no matter the file exists or not)

Fix : 

I created a PR on github.


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

More information about the Nasm-bugs mailing list