X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=wpa_supplicant%2Fbgscan_learn.c;h=adf82d87139859c54aaae8c3c23c8b878dcae9e8;hb=86c93df1d626c42147db2f2a6dfb5dcad83477ec;hp=5385ccee628ff64520020890cd596862d054e5f5;hpb=be18030b5949d199d8f83af36d8cab8a9a97fdba;p=android-x86%2Fexternal-wpa_supplicant_8.git diff --git a/wpa_supplicant/bgscan_learn.c b/wpa_supplicant/bgscan_learn.c index 5385cce..adf82d8 100644 --- a/wpa_supplicant/bgscan_learn.c +++ b/wpa_supplicant/bgscan_learn.c @@ -2,14 +2,8 @@ * WPA Supplicant - background scan and roaming module: learn * Copyright (c) 2009-2010, Jouni Malinen * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Alternatively, this software may be distributed under the terms of BSD - * license. - * - * See README and COPYING for more details. + * This software may be distributed under the terms of the BSD license. + * See README for more details. */ #include "includes.h" @@ -81,7 +75,7 @@ static void bgscan_learn_add_neighbor(struct bgscan_learn_bss *bss, if (bssid_in_array(bss->neigh, bss->num_neigh, bssid)) return; - n = os_realloc(bss->neigh, (bss->num_neigh + 1) * ETH_ALEN); + n = os_realloc_array(bss->neigh, bss->num_neigh + 1, ETH_ALEN); if (n == NULL) return; @@ -225,7 +219,7 @@ static int * bgscan_learn_get_freqs(struct bgscan_learn_data *data, dl_list_for_each(bss, &data->bss, struct bgscan_learn_bss, list) { if (in_array(freqs, bss->freq)) continue; - n = os_realloc(freqs, (*count + 2) * sizeof(int)); + n = os_realloc_array(freqs, *count + 2, sizeof(int)); if (n == NULL) return freqs; freqs = n; @@ -254,7 +248,7 @@ static int * bgscan_learn_get_probe_freq(struct bgscan_learn_data *data, wpa_printf(MSG_DEBUG, "bgscan learn: Probe new freq " "%u", data->supp_freqs[idx]); data->probe_idx = idx; - n = os_realloc(freqs, (count + 2) * sizeof(int)); + n = os_realloc_array(freqs, count + 2, sizeof(int)); if (n == NULL) return freqs; freqs = n; @@ -366,7 +360,7 @@ static int * bgscan_learn_get_supp_freqs(struct wpa_supplicant *wpa_s) for (j = 0; j < modes[i].num_channels; j++) { if (modes[i].channels[j].flag & HOSTAPD_CHAN_DISABLED) continue; - n = os_realloc(freqs, (count + 2) * sizeof(int)); + n = os_realloc_array(freqs, count + 2, sizeof(int)); if (n == NULL) continue;