summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-05-25 17:39:07 +0000
committertedu <tedu@openbsd.org>2014-05-25 17:39:07 +0000
commitf8c28d465cdba4763b46594f18c056d49e03c33f (patch)
tree347f02cf5d09eb03de21466675dfffcda717a118
parentremove unused shit. from Alexander Schrijver (diff)
downloadwireguard-openbsd-f8c28d465cdba4763b46594f18c056d49e03c33f.tar.xz
wireguard-openbsd-f8c28d465cdba4763b46594f18c056d49e03c33f.zip
use calloc. from Benjamin Baier
-rw-r--r--games/hunt/huntd/answer.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/games/hunt/huntd/answer.c b/games/hunt/huntd/answer.c
index 998f21bb9ba..c8ae243c655 100644
--- a/games/hunt/huntd/answer.c
+++ b/games/hunt/huntd/answer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: answer.c,v 1.12 2014/03/23 02:42:47 tedu Exp $ */
+/* $OpenBSD: answer.c,v 1.13 2014/05/25 17:39:07 tedu Exp $ */
/* $NetBSD: answer.c,v 1.3 1997/10/10 16:32:50 lukem Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -77,13 +77,12 @@ answer_first()
}
/* Remember this spawning connection: */
- sp = (struct spawn *)malloc(sizeof *sp);
+ sp = calloc(1, sizeof *sp);
if (sp == NULL) {
- logit(LOG_ERR, "malloc");
+ logit(LOG_ERR, "calloc");
close(newsock);
return;
}
- memset(sp, '\0', sizeof *sp);
/* Keep the calling machine's source addr for ident purposes: */
memcpy(&sp->source, &sockstruct, sizeof sp->source);