findutils: plug a memory leak (close #22857)

Using the upstream patch directly.  It's copied in nixpkgs, because:
 - fetchpatch isn't usable at this point in bootstrapping,
 - the upstream patch creates collisions in NEWS.
This commit is contained in:
Vladimír Čunát 2017-02-16 19:16:51 +01:00
parent e962a3c95f
commit 524de86db0
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
2 changed files with 24 additions and 1 deletions

View File

@ -8,7 +8,9 @@ stdenv.mkDerivation rec {
sha256 = "178nn4dl7wbcw499czikirnkniwnx36argdnqgz4ik9i6zvwkm6y";
};
nativeBuildInputs = [ coreutils ];
patches = [ ./memory-leak.patch ];
buildInputs = [ coreutils ]; # bin/updatedb script needs to call sort
doCheck = !stdenv.isDarwin;

View File

@ -0,0 +1,21 @@
http://git.savannah.gnu.org/cgit/findutils.git/patch/?id=c1556892a
diff --git a/find/fstype.c b/find/fstype.c
index 535f920..a0ac8bc 100644
--- a/find/fstype.c
+++ b/find/fstype.c
@@ -75,14 +75,7 @@ free_file_system_list (struct mount_entry *p)
while (p)
{
struct mount_entry *pnext = p->me_next;
-
- free (p->me_devname);
- free (p->me_mountdir);
-
- if (p->me_type_malloced)
- free (p->me_type);
- p->me_next = NULL;
- free (p);
+ free_mount_entry (p);
p = pnext;
}
}