summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1999-11-28 04:38:41 +0000
committerlukem <lukem@NetBSD.org>1999-11-28 04:38:41 +0000
commitd51504eeb3e1001192b2b77683ef7964358684ff (patch)
tree586635661dd95b2f808473aab66d75a5cf879056 /libexec
parenta8d12b09cd7adb2df2c6d5e3d00ea0e28473eede (diff)
check return val of sl_init() and sl_add()
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/conf.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libexec/ftpd/conf.c b/libexec/ftpd/conf.c
index 0e16948b37c..56c2e59bc7c 100644
--- a/libexec/ftpd/conf.c
+++ b/libexec/ftpd/conf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: conf.c,v 1.21 1999/08/25 20:07:33 christos Exp $ */
+/* $NetBSD: conf.c,v 1.22 1999/11/28 04:38:41 lukem Exp $ */
/*-
* Copyright (c) 1997, 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: conf.c,v 1.21 1999/08/25 20:07:33 christos Exp $");
+__RCSID("$NetBSD: conf.c,v 1.22 1999/11/28 04:38:41 lukem Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -332,6 +332,10 @@ show_chdir_messages(code)
/* Setup list for directory cache */
if (slist == NULL)
slist = sl_init();
+ if (slist == NULL) {
+ syslog(LOG_WARNING, "can't allocate memory for stringlist");
+ return;
+ }
/* Check if this directory has already been visited */
if (getcwd(cwd, sizeof(cwd) - 1) == NULL) {
@@ -346,7 +350,8 @@ show_chdir_messages(code)
syslog(LOG_WARNING, "can't strdup");
return;
}
- sl_add(slist, cp);
+ if (sl_add(slist, cp) == -1)
+ syslog(LOG_WARNING, "can't add `%s' to stringlist", cp);
/* First check for a display file */
if (curclass.display != NULL && curclass.display[0] &&