projects
/
libeap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
72822e7
)
Verify that os_get_time() does not fail before using the time value when
author
Jouni Malinen
<j@w1.fi>
Thu, 28 Feb 2008 01:50:36 +0000
(17:50 -0800)
committer
Jouni Malinen
<j@w1.fi>
Thu, 28 Feb 2008 01:50:36 +0000
(17:50 -0800)
registering an eloop timeout.
src/utils/eloop.c
patch
|
blob
|
history
diff --git
a/src/utils/eloop.c
b/src/utils/eloop.c
index
021c516
..
f988e94
100644
(file)
--- a/
src/utils/eloop.c
+++ b/
src/utils/eloop.c
@@
-242,7
+242,10
@@
int eloop_register_timeout(unsigned int secs, unsigned int usecs,
timeout = os_malloc(sizeof(*timeout));
if (timeout == NULL)
return -1;
- os_get_time(&timeout->time);
+ if (os_get_time(&timeout->time) < 0) {
+ os_free(timeout);
+ return -1;
+ }
timeout->time.sec += secs;
timeout->time.usec += usecs;
while (timeout->time.usec >= 1000000) {