diff options
author | Alexander Guy <alexander@cvs.openbsd.org> | 2004-06-17 18:09:34 +0000 |
---|---|---|
committer | Alexander Guy <alexander@cvs.openbsd.org> | 2004-06-17 18:09:34 +0000 |
commit | c74875d05b67dbdb0d781af861f32ebfb96c02fd (patch) | |
tree | b02bc9d5812e72ddef1c59648ebd1ba64578e469 | |
parent | 3a55c8c87458ea7988be376c7e0ca408b1c1409a (diff) |
err on calloc failure; ok henning@
-rw-r--r-- | usr.sbin/rdate/ntp.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/rdate/ntp.c b/usr.sbin/rdate/ntp.c index 193f864d69b..fc8d2b4fd1b 100644 --- a/usr.sbin/rdate/ntp.c +++ b/usr.sbin/rdate/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.21 2004/06/09 07:15:56 alexander Exp $ */ +/* $OpenBSD: ntp.c,v 1.22 2004/06/17 18:09:33 alexander Exp $ */ /* * Copyright (c) 1996, 1997 by N.M. Maclaren. All rights reserved. @@ -310,10 +310,9 @@ read_packet(int fd, struct ntp_data *data, double *off, double *error) fd_set *rfds; rfds = (fd_set *)calloc(howmany(fd + 1, NFDBITS), sizeof(fd_mask)); - if (!rfds) { - warnx("calloc() failed"); - return 1; - } + + if (rfds == NULL) + err(1, "calloc"); FD_SET(fd, rfds); |