Use os_calloc() instead of os_zalloc()
Automatic changes with spatch using the following semantic patch: @@ constant C; type T; @@ - os_zalloc(C*sizeof(T)) + os_calloc(C,sizeof(T)) @@ expression E; type T; @@ - os_zalloc((E)*sizeof(T)) + os_calloc(E,sizeof(T)) Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
33d0b1579b
commit
faebdeaa9e
6 changed files with 14 additions and 14 deletions
|
@ -58,7 +58,7 @@ gas_dialog_create(struct hostapd_data *hapd, const u8 *addr, u8 dialog_token)
|
|||
}
|
||||
|
||||
if (sta->gas_dialog == NULL) {
|
||||
sta->gas_dialog = os_zalloc(GAS_DIALOG_MAX *
|
||||
sta->gas_dialog = os_calloc(GAS_DIALOG_MAX,
|
||||
sizeof(struct gas_dialog_info));
|
||||
if (sta->gas_dialog == NULL)
|
||||
return NULL;
|
||||
|
|
|
@ -1878,7 +1878,7 @@ static struct hostapd_iface * hostapd_data_alloc(
|
|||
hapd_iface->conf = conf;
|
||||
hapd_iface->num_bss = conf->num_bss;
|
||||
|
||||
hapd_iface->bss = os_zalloc(conf->num_bss *
|
||||
hapd_iface->bss = os_calloc(conf->num_bss,
|
||||
sizeof(struct hostapd_data *));
|
||||
if (hapd_iface->bss == NULL)
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue