summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sasyncd/conf.y
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-08-20 22:39:29 +0000
committerderaadt <deraadt@openbsd.org>2015-08-20 22:39:29 +0000
commit35de856ed2be5e6bd284466437ecec8c238ee751 (patch)
tree52317c381e559008ce133dcf7b89f7ed3ce53858 /usr.sbin/sasyncd/conf.y
parentDo not cast result of malloc/calloc/realloc* if stdlib.h is in scope (diff)
downloadwireguard-openbsd-35de856ed2be5e6bd284466437ecec8c238ee751.tar.xz
wireguard-openbsd-35de856ed2be5e6bd284466437ecec8c238ee751.zip
stdlib.h is in scope; do not cast malloc/calloc/realloc*
ok millert krw
Diffstat (limited to 'usr.sbin/sasyncd/conf.y')
-rw-r--r--usr.sbin/sasyncd/conf.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/sasyncd/conf.y b/usr.sbin/sasyncd/conf.y
index fb3a0b2b365..5be15a4e5e7 100644
--- a/usr.sbin/sasyncd/conf.y
+++ b/usr.sbin/sasyncd/conf.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.y,v 1.17 2012/12/21 13:53:01 gsoares Exp $ */
+/* $OpenBSD: conf.y,v 1.18 2015/08/20 22:39:29 deraadt Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -33,6 +33,7 @@
#include <ctype.h>
#include <fcntl.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pwd.h>
@@ -182,8 +183,7 @@ setting : INTERFACE STRING
if (duplicate)
free($2);
else {
- peer = (struct syncpeer *)calloc(1,
- sizeof *peer);
+ peer = calloc(1, sizeof *peer);
if (!peer) {
log_err("config: calloc(1, %lu) "
"failed", sizeof *peer);
@@ -372,7 +372,7 @@ conf_parse_file(char *cfgfile)
goto bad;
conflen = st.st_size;
- buf = (char *)malloc(conflen + 1);
+ buf = malloc(conflen + 1);
if (!buf) {
log_err("malloc(%d) failed", conflen + 1);
close(fd);