summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-08-03 22:04:29 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-08-03 22:04:29 +0000
commita917ae9e72545a050b91b403fba7a52764ad8b90 (patch)
treee0af308bcbf6de2faf22d2678e342166f8d02751 /lib
parent7bf38ff92e2fb6973f90d911365b6a2e7a0087ac (diff)
If malloc() fails, perror() and return. This is non-optimal but because
svr_run() is void we have no way to pass back error status.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/rpc/svc_run.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libc/rpc/svc_run.c b/lib/libc/rpc/svc_run.c
index 754605c0117..c75a9cc7e4f 100644
--- a/lib/libc/rpc/svc_run.c
+++ b/lib/libc/rpc/svc_run.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: svc_run.c,v 1.12 2002/02/16 21:27:24 millert Exp $";
+static char *rcsid = "$OpenBSD: svc_run.c,v 1.13 2002/08/03 22:04:28 millert Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -56,7 +56,10 @@ svc_run()
if (__svc_fdset) {
int bytes = howmany(__svc_fdsetsize, NFDBITS) *
sizeof(fd_mask);
- fds = (fd_set *)malloc(bytes); /* XXX */
+ if ((fds = (fd_set *)malloc(bytes)) == NULL) {
+ perror("svc_run");
+ return;
+ }
memcpy(fds, __svc_fdset, bytes);
} else
fds = NULL;