summaryrefslogtreecommitdiff
path: root/lib/libc/gen
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-07-12 01:47:42 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-07-12 01:47:42 +0000
commit4ee93a6d36611bf801112c2ed131bb8b18b7363c (patch)
treed6373e5b21159dfca64b3bb520f82da04cd3508e /lib/libc/gen
parent1118a47e0d8bb63890c4f9382a19e36ddca77c64 (diff)
Add a missing check for fts_alloc() returning NULL; Chad Loder
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/fts.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index 079b4e806c9..0217e6bae25 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fts.c,v 1.31 2002/06/27 22:21:28 deraadt Exp $ */
+/* $OpenBSD: fts.c,v 1.32 2002/07/12 01:47:41 millert Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#else
-static char rcsid[] = "$OpenBSD: fts.c,v 1.31 2002/06/27 22:21:28 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: fts.c,v 1.32 2002/07/12 01:47:41 millert Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -125,7 +125,8 @@ fts_open(argv, options, compar)
goto mem3;
}
- p = fts_alloc(sp, *argv, len);
+ if ((p = fts_alloc(sp, *argv, len)) == NULL)
+ goto mem3;
p->fts_level = FTS_ROOTLEVEL;
p->fts_parent = parent;
p->fts_accpath = p->fts_name;