bugGNU patch - Bugs: bug #56684, Memory leak

 
 

bug #56684: Memory leak

Submitter:  Manh-Dung Nguyen <strongcourage>
Submitted:  Sun 28 Jul 2019 07:02:45 AM UTC
   
 
Category:  Parser / Internal Representation Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 28 Jul 2019 07:02:45 AM UTC, original submission:  

Hi,

I found a memory leak in the latest commit 76e7758 on master.

PoC: https://github.com/strongcourage/PoCs/blob/master/patch_76e7758/PoC_ml
Command: patch -Rf < $PoC

ASAN says:
==16487==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 56 byte(s) in 4 object(s) allocated from:
    #0 0x7f7544c79662 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98662)
    #1 0x448729 in xmalloc ../../lib/xmalloc.c:41
    #2 0x42556f in make_tempfile ../../src/util.c:1673
    #3 0x4062eb in main ../../src/patch.c:322
    #4 0x7f754483782f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

Direct leak of 56 byte(s) in 4 object(s) allocated from:
    #0 0x7f7544c79662 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98662)
    #1 0x448729 in xmalloc ../../lib/xmalloc.c:41
    #2 0x42556f in make_tempfile ../../src/util.c:1673
    #3 0x40b28e in init_reject ../../src/patch.c:1624
    #4 0x40a329 in abort_hunk ../../src/patch.c:1413
    #5 0x406b0f in main ../../src/patch.c:489
    #6 0x7f754483782f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

SUMMARY: AddressSanitizer: 112 byte(s) leaked in 8 allocation(s).

Thanks,
Manh Dung

Manh-Dung Nguyen <strongcourage>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #47274:  PoC_ml added by strongcourage (49KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by agruen (Updated the item)
  • -email is unavailable- added by strongcourage (Submitted the item)
  • -email is unavailable- added by strongcourage
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-07-28 agruen CategoryNone Parser / Internal Representation
    2019-07-28 strongcourage Attached File- Added PoC_ml, #47274
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code