diff options
author | 2010-05-14 11:52:19 +0000 | |
---|---|---|
committer | 2010-05-14 11:52:19 +0000 | |
commit | 88d8283ad32c0007bc931ea563d3dfdb91e059f0 (patch) | |
tree | 8667774743f2435b668c6da869d8e9dc718496dd | |
parent | allocate all struct event's on the heap, it looks cleaner, feels better (diff) | |
download | wireguard-openbsd-88d8283ad32c0007bc931ea563d3dfdb91e059f0.tar.xz wireguard-openbsd-88d8283ad32c0007bc931ea563d3dfdb91e059f0.zip |
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
-rw-r--r-- | usr.sbin/dvmrpd/control.c | 4 | ||||
-rw-r--r-- | usr.sbin/ldpd/control.c | 4 | ||||
-rw-r--r-- | usr.sbin/ospf6d/control.c | 4 | ||||
-rw-r--r-- | usr.sbin/ospfd/control.c | 4 | ||||
-rw-r--r-- | usr.sbin/ripd/control.c | 4 | ||||
-rw-r--r-- | usr.sbin/snmpd/control.c | 4 |
6 files changed, 12 insertions, 12 deletions
diff --git a/usr.sbin/dvmrpd/control.c b/usr.sbin/dvmrpd/control.c index d5df79ecae5..fcb73eded14 100644 --- a/usr.sbin/dvmrpd/control.c +++ b/usr.sbin/dvmrpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.12 2010/02/21 20:53:20 michele Exp $ */ +/* $OpenBSD: control.c,v 1.13 2010/05/14 11:52:19 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -125,7 +125,7 @@ control_accept(int listenfd, short event, void *bula) 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; diff --git a/usr.sbin/ldpd/control.c b/usr.sbin/ldpd/control.c index 0bffb106132..41ab2a0294e 100644 --- a/usr.sbin/ldpd/control.c +++ b/usr.sbin/ldpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.7 2010/02/25 21:07:31 michele Exp $ */ +/* $OpenBSD: control.c,v 1.8 2010/05/14 11:52:19 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -124,7 +124,7 @@ control_accept(int listenfd, short event, void *bula) 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; diff --git a/usr.sbin/ospf6d/control.c b/usr.sbin/ospf6d/control.c index b7f95997bfa..7403e8150df 100644 --- a/usr.sbin/ospf6d/control.c +++ b/usr.sbin/ospf6d/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.14 2010/02/21 20:53:20 michele Exp $ */ +/* $OpenBSD: control.c,v 1.15 2010/05/14 11:52:19 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -123,7 +123,7 @@ control_accept(int listenfd, short event, void *bula) 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; diff --git a/usr.sbin/ospfd/control.c b/usr.sbin/ospfd/control.c index dabcebcf1d1..2c1d0cd5b20 100644 --- a/usr.sbin/ospfd/control.c +++ b/usr.sbin/ospfd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.32 2010/02/21 20:53:20 michele Exp $ */ +/* $OpenBSD: control.c,v 1.33 2010/05/14 11:52:19 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -125,7 +125,7 @@ control_accept(int listenfd, short event, void *bula) 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; diff --git a/usr.sbin/ripd/control.c b/usr.sbin/ripd/control.c index 62679f78945..a38edcb4350 100644 --- a/usr.sbin/ripd/control.c +++ b/usr.sbin/ripd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.14 2010/02/21 20:53:20 michele Exp $ */ +/* $OpenBSD: control.c,v 1.15 2010/05/14 11:52:19 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -124,7 +124,7 @@ control_accept(int listenfd, short event, void *bula) 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; 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; |