bug-findutils
[Top][All Lists]
Advanced

[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:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6 Mnenhy/0.7.5.666

URL:
  <http://savannah.gnu.org/bugs/?20662>

                 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

    _______________________________________________________

Details:

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/.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?20662>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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