diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-20 22:39:31 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-20 22:39:31 +0000 |
commit | aa0cb4643fc13729e7874a5eb16e9eecd90c1ced (patch) | |
tree | 1b6337f56b8a55bfda6bab69525fe62675d14e0e /usr.sbin/hostapd | |
parent | 6e5d9523d6273368df6377a4db98a9533d11505c (diff) |
stdlib.h is in scope; do not cast malloc/calloc/realloc*
ok millert krw
Diffstat (limited to 'usr.sbin/hostapd')
-rw-r--r-- | usr.sbin/hostapd/parse.y | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/hostapd/parse.y b/usr.sbin/hostapd/parse.y index 1ffd4c2de09..c6a8beb4588 100644 --- a/usr.sbin/hostapd/parse.y +++ b/usr.sbin/hostapd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.49 2015/01/16 06:40:17 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.50 2015/08/20 22:39:29 deraadt Exp $ */ /* * Copyright (c) 2004, 2005, 2006 Reyk Floeter <reyk@openbsd.org> @@ -367,8 +367,8 @@ event : HOSTAP HANDLE /* IEEE 802.11 raw frame to send as an action */ frame_ieee80211 = &frame.f_action_data.a_frame; } action limit rate { - if ((frame_ptr = (struct hostapd_frame *)calloc(1, - sizeof(struct hostapd_frame))) == NULL) { + if ((frame_ptr = calloc(1, sizeof(struct hostapd_frame))) + == NULL) { yyerror("calloc"); YYERROR; } @@ -647,7 +647,7 @@ authalg : OPEN REQUEST frmreason : frmreason_l { if ($1 != 0) { - if ((frame_ieee80211->i_data = (u_int16_t *) + if ((frame_ieee80211->i_data = malloc(sizeof(u_int16_t))) == NULL) { yyerror("failed to allocate " "reason code %u", $1); @@ -1611,7 +1611,7 @@ symset(const char *nam, const char *val, int persist) free(sym); } } - if ((sym = (struct sym *)calloc(1, sizeof(*sym))) == NULL) + if ((sym = calloc(1, sizeof(*sym))) == NULL) return (-1); sym->nam = strdup(nam); @@ -1645,7 +1645,7 @@ hostapd_parse_symset(char *s) return (-1); len = strlen(s) - strlen(val) + 1; - if ((sym = (char *)malloc(len)) == NULL) + if ((sym = malloc(len)) == NULL) hostapd_fatal("cmdline_symset: malloc"); (void)strlcpy(sym, s, len); |