summaryrefslogtreecommitdiff
path: root/libexec/fingerd
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2001-03-05 10:59:50 +0000
committerKris Kennaway <kris@FreeBSD.org>2001-03-05 10:59:50 +0000
commit9626cc7467e29d5ec52a9855849254ac5001e765 (patch)
tree7ae523a7ce508c5c550fe827ffe85d499621fab3 /libexec/fingerd
parent966dde0e53c0261974f66eed2ebf9eef97f3285d (diff)
Notes
Diffstat (limited to 'libexec/fingerd')
-rw-r--r--libexec/fingerd/fingerd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libexec/fingerd/fingerd.c b/libexec/fingerd/fingerd.c
index 15463e8b3726..8524acd1ffdb 100644
--- a/libexec/fingerd/fingerd.c
+++ b/libexec/fingerd/fingerd.c
@@ -45,6 +45,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
+#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -54,6 +55,7 @@ static const char rcsid[] =
#include <unistd.h>
#include <syslog.h>
+#include <libutil.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
@@ -118,11 +120,13 @@ main(argc, argv)
end = memchr(line, 0, sizeof(line));
if (end == NULL) {
- t = malloc(sizeof(line) + 1);
+ if ((t = malloc(sizeof(line) + 1)) == NULL)
+ logerr("malloc: %s", strerror(errno));
memcpy(t, line, sizeof(line));
t[sizeof(line)] = 0;
} else {
- t = strdup(line);
+ if ((t = strdup(line)) == NULL)
+ logerr("strdup: %s", strerror(errno));
}
for (end = t; *end; end++)
if (*end == '\n' || *end == '\r')