summaryrefslogtreecommitdiff
path: root/lib/libc/gen/fts-compat.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1998-07-03 08:21:05 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1998-07-03 08:21:05 +0000
commit8a507b98ab8d7f882e4c691ebfa4e84d6651f9d1 (patch)
treea460808734956f8ae085ed0bbe0bdf731d7dfcdf /lib/libc/gen/fts-compat.c
parente25169f23997da32ddf8d011b5514dd533d9bcb4 (diff)
Notes
Diffstat (limited to 'lib/libc/gen/fts-compat.c')
-rw-r--r--lib/libc/gen/fts-compat.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c
index 73832e59ff18..02cad6c00dc4 100644
--- a/lib/libc/gen/fts-compat.c
+++ b/lib/libc/gen/fts-compat.c
@@ -241,14 +241,15 @@ fts_close(sp)
(void)close(sp->fts_rfd);
}
- /* Free up the stream pointer. */
- free(sp);
-
/* Set errno and return. */
if (!ISSET(FTS_NOCHDIR) && saved_errno) {
+ /* Free up the stream pointer. */
+ free(sp);
errno = saved_errno;
return (-1);
}
+ /* Free up the stream pointer. */
+ free(sp);
return (0);
}