diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-05-14 11:52:20 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-05-14 11:52:20 +0000 |
commit | 3a30cb322b7a7d97b4ae87ca7c8118ccbfa082f6 (patch) | |
tree | ca8c695449d506b3f6ce4dfb0d4e2a537b3daeda /usr.sbin/snmpd | |
parent | 69cfced606e9755ce640af6e463cb96973577377 (diff) |
Use calloc() instead of malloc() to allocate the connection structure. This
way the memory is zeroed. This is equivalent to the relayd commit by reyk.
OK reyk, jsg
Diffstat (limited to 'usr.sbin/snmpd')
-rw-r--r-- | usr.sbin/snmpd/control.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/snmpd/control.c b/usr.sbin/snmpd/control.c index 5072c4a1796..57e69e57a2b 100644 --- a/usr.sbin/snmpd/control.c +++ b/usr.sbin/snmpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.12 2009/12/02 19:10:02 mk Exp $ */ +/* $OpenBSD: control.c,v 1.13 2010/05/14 11:52:19 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -148,7 +148,7 @@ control_accept(int listenfd, short event, void *arg) session_socket_blockmode(connfd, BM_NONBLOCK); - if ((c = malloc(sizeof(struct ctl_conn))) == NULL) { + if ((c = calloc(1, sizeof(struct ctl_conn))) == NULL) { log_warn("control_accept"); close(connfd); return; |