aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/eloop_win.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-08-13 18:21:23 (GMT)
committerJouni Malinen <j@w1.fi>2012-08-13 18:21:23 (GMT)
commit067ffa269611a740c897b9d54d08d6529c9545f6 (patch)
tree01e77c70650244564d9102a9554bef25a50c554c /src/utils/eloop_win.c
parentb0cda9bd4662b6cfa0684b933fb9a12a84642e11 (diff)
downloadhostap-067ffa269611a740c897b9d54d08d6529c9545f6.zip
hostap-067ffa269611a740c897b9d54d08d6529c9545f6.tar.gz
hostap-067ffa269611a740c897b9d54d08d6529c9545f6.tar.bz2
Convert os_realloc() for an array to use os_realloc_array()
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/utils/eloop_win.c')
-rw-r--r--src/utils/eloop_win.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/utils/eloop_win.c b/src/utils/eloop_win.c
index 1cf5579..1fafeb2 100644
--- a/src/utils/eloop_win.c
+++ b/src/utils/eloop_win.c
@@ -98,8 +98,8 @@ static int eloop_prepare_handles(void)
if (eloop.num_handles > eloop.reader_count + eloop.event_count + 8)
return 0;
- n = os_realloc(eloop.handles,
- eloop.num_handles * 2 * sizeof(eloop.handles[0]));
+ n = os_realloc_array(eloop.handles, eloop.num_handles * 2,
+ sizeof(eloop.handles[0]));
if (n == NULL)
return -1;
eloop.handles = n;
@@ -128,8 +128,8 @@ int eloop_register_read_sock(int sock, eloop_sock_handler handler,
WSACloseEvent(event);
return -1;
}
- tmp = os_realloc(eloop.readers,
- (eloop.reader_count + 1) * sizeof(struct eloop_sock));
+ tmp = os_realloc_array(eloop.readers, eloop.reader_count + 1,
+ sizeof(struct eloop_sock));
if (tmp == NULL) {
WSAEventSelect(sock, event, 0);
WSACloseEvent(event);
@@ -191,8 +191,8 @@ int eloop_register_event(void *event, size_t event_size,
if (eloop_prepare_handles())
return -1;
- tmp = os_realloc(eloop.events,
- (eloop.event_count + 1) * sizeof(struct eloop_event));
+ tmp = os_realloc_array(eloop.events, eloop.event_count + 1,
+ sizeof(struct eloop_event));
if (tmp == NULL)
return -1;
@@ -392,9 +392,8 @@ int eloop_register_signal(int sig, eloop_signal_handler handler,
{
struct eloop_signal *tmp;
- tmp = os_realloc(eloop.signals,
- (eloop.signal_count + 1) *
- sizeof(struct eloop_signal));
+ tmp = os_realloc_array(eloop.signals, eloop.signal_count + 1,
+ sizeof(struct eloop_signal));
if (tmp == NULL)
return -1;