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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

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

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>
Group administrator
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>
Group administrator

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    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.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-06-20 bens Open/ClosedOpen Closed
    2016-02-28 bens StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code