summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2010-05-14 11:11:11 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2010-05-14 11:11:11 +0000
commitaf1420407e436fd56870244a8cf440bd1f534196 (patch)
tree924b0606de5681928dddce3cbf20e857203daa45
parenta9afe22d0ef7ce4b9df4171bb1ea5d680c1d868e (diff)
zero out the allocate memory for a new control connection via calloc()
ok jsg@ gilles@
-rw-r--r--usr.sbin/relayd/control.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/relayd/control.c b/usr.sbin/relayd/control.c
index bbcde386601..58bfb506102 100644
--- a/usr.sbin/relayd/control.c
+++ b/usr.sbin/relayd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.35 2010/05/10 02:00:50 krw Exp $ */
+/* $OpenBSD: control.c,v 1.36 2010/05/14 11:11:10 reyk Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -142,7 +142,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) {
close(connfd);
log_warn("control_accept");
return;