bugGNU nano - Bugs: bug #47285, memory leak when a syntax contains...

 
 

bug #47285: memory leak when a syntax contains multiple header or magic commands

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Sat 27 Feb 2016 05:04:35 PM UTC  
 
Severity: 3 - NormalStatus: Fixed
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 28 Feb 2016 04:57:56 PM UTC, comment #1:

Fixed in SVN, r5694. Multiple header and magic commands are now allowed -- the regexes they define are accumulated.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat 27 Feb 2016 05:04:35 PM UTC, original submission:

One would expect the header and magic regexes to accumulate when there are multiple commands, but they don't -- the first regexes are simply lost.

To reproduce, put for example this at the end of your nanorc file:

syntax "zero" "super$"
header "oww"
header "second"
magic "qua!"
magic "twO"

Then run nano. Result in valgrind:

==5915== 16 (12 direct, 4 indirect) bytes in 1 blocks are definitely lost in loss record 74 of 545
==5915== at 0x4024F20: malloc (vg_replace_malloc.c:236)
==5915== by 0x806A0E2: nmalloc (utils.c:388)
==5915== by 0x80607B2: parse_header_exp (rcfile.c:894)
==5915== by 0x8060E90: parse_rcfile (rcfile.c:1161)
==5915== by 0x80618A1: do_rcfile (rcfile.c:1438)
==5915== by 0x805D489: main (nano.c:2313)
==5915==
==5915== 17 (12 direct, 5 indirect) bytes in 1 blocks are definitely lost in loss record 75 of 545
==5915== at 0x4024F20: malloc (vg_replace_malloc.c:236)
==5915== by 0x806A0E2: nmalloc (utils.c:388)
==5915== by 0x80608F5: parse_magic_exp (rcfile.c:959)
==5915== by 0x8060E69: parse_rcfile (rcfile.c:1156)
==5915== by 0x80618A1: do_rcfile (rcfile.c:1438)
==5915== by 0x805D489: main (nano.c:2313)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 20 Jun 2016 09:43:45 AM UTCbensOpen/ClosedOpen=>Closed
    Sun 28 Feb 2016 04:57:56 PM UTCbensStatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1