[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #20662] memory leak from gnulib dirname module

From: Eric Blake
Subject: [bug #20662] memory leak from gnulib dirname module
Date: Thu, 02 Aug 2007 12:57:21 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070725 Firefox/ Mnenhy/


                 Summary: memory leak from gnulib dirname module
                 Project: findutils
            Submitted by: ericb
            Submitted on: Thursday 08/02/2007 at 06:57
                Category: find
                Severity: 3 - Normal
              Item Group: Wrong result
                  Status: In Progress
                 Privacy: Public
             Assigned to: ericb
         Originator Name: Eric Blake
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.28
           Fixed Release: None



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
./find/pred.c:  base = base_name (pathname);
./find/pred.c:  base = base_name (pathname);
./locate/locate.c:  procdata->munged_filename =

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


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]