diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-25 17:39:08 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-25 17:39:08 +0000 |
commit | a09c85b81fa394e23bf6bca81ba12db8a6e834fd (patch) | |
tree | 76eda35526da662042bd10eecbcb803d7c8cda34 /games/hunt | |
parent | afe78d0924762a7075625f43329bcb0d49b28156 (diff) |
use calloc. from Benjamin Baier
Diffstat (limited to 'games/hunt')
-rw-r--r-- | games/hunt/huntd/answer.c | 7 |
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); |