]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Fix memory leak in idmapd.
authorKevin Coffman <kwc@citi.umich.edu>
Thu, 8 Feb 2007 22:27:14 +0000 (17:27 -0500)
committerNeil Brown <neilb@suse.de>
Fri, 9 Feb 2007 00:42:19 +0000 (11:42 +1100)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
There is a pretty nasty memory leak in idmapd in dirscancb(). Some of
our customers have reported that idmapd can eat gigabytes of memory on
machines with a large number of mounts and unmounts and a long uptime.

That function uses scandir(), which malloc's an array of strings, but
dirscancb() never frees the strings or the array. The following patch
should correct this, but I've not yet tested it on 1.0.10 (only on the
RHEL4 1.0.6 version). Still, the code is very similar and I'm fairly
certain the problem exists in both versions.
Signed-off-by: Neil Brown <neilb@suse.de>

No differences found