summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospfd/control.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2010-05-14 11:52:19 +0000
committerclaudio <claudio@openbsd.org>2010-05-14 11:52:19 +0000
commit88d8283ad32c0007bc931ea563d3dfdb91e059f0 (patch)
tree8667774743f2435b668c6da869d8e9dc718496dd /usr.sbin/ospfd/control.c
parentallocate all struct event's on the heap, it looks cleaner, feels better (diff)
downloadwireguard-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
Diffstat (limited to 'usr.sbin/ospfd/control.c')
-rw-r--r--usr.sbin/ospfd/control.c4
1 files changed, 2 insertions, 2 deletions
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;