bugfindutils - Bugs: bug #20662, memory leak from gnulib dirname...

 
 

bug #20662: memory leak from gnulib dirname module

Submitter:  Eric Blake <ericb>
Submitted:  Thu 02 Aug 2007 12:57:20 PM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  Fixed
Privacy:  Public Assigned to:  ericb
Originator Name:  Eric Blake Open/Closed:  Closed
Release:  4.2.28 Fixed Release:  4.3.9
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 02 Aug 2007 12:57:20 PM UTC, original submission:  

In July 2006, gnulib changed the dirname module so that base_name started returning a malloc'd result, for similarity with dir_name, and added last_component as the replacement that did not malloc.

That means the following constructs in CVS head now leak memory (and similar constructs are on the 4.2.x branch), since 4.2.28 and 4.3.1:

./find/find.c:  char *base = base_name(pathname);
./find/pred.c:   checked_print_quoted (dest, segment->text, base_name (pathname));
./find/pred.c:  base = base_name (pathname);
./find/pred.c:  base = base_name (pathname);
./locate/locate.c:  procdata->munged_filename = base_name(procdata->original_filename);

They should either free the memory, or use s/base_name/last_component/.

Eric Blake <ericb>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

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 jay (Updated the item)
  • -email is unavailable- added by ericb (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.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-11-11 jay Open/ClosedOpen Closed
        Fixed ReleaseNone 4.3.9
    2007-08-05 ericb StatusIn Progress Fixed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code