summaryrefslogtreecommitdiff
path: root/lib/fts.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-04-14 16:26:15 +0000
committerJim Meyering <jim@meyering.net>2006-04-14 16:26:15 +0000
commit8085d02998442d1e77f3c855f4a96d6793e028f9 (patch)
tree30153c9ee01edeade004452b5a10950945621766 /lib/fts.c
parentd657c35562ee2161139646005d4bcf41137ebd81 (diff)
downloadcoreutils-8085d02998442d1e77f3c855f4a96d6793e028f9.tar.xz
(fts_build): Free `head' before returning NULL, in two places,
to avoid leaks. Patch from glibc.
Diffstat (limited to 'lib/fts.c')
-rw-r--r--lib/fts.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/fts.c b/lib/fts.c
index eede736d0..e9896cdf8 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -1010,6 +1010,7 @@ mem1: saved_errno = errno;
fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
cur->fts_info = FTS_ERR;
SET(FTS_STOP);
+ fts_lfree(head);
return (NULL);
}
@@ -1017,6 +1018,7 @@ mem1: saved_errno = errno;
if (!nitems) {
if (type == BREAD)
cur->fts_info = FTS_DP;
+ fts_lfree(head);
return (NULL);
}