eloop: Clear timeout data during allocation
Better make sure the eloop_timeout data gets fully initialized. The current code is filling in all the fields, but it is clearer to just zero the buffer to make sure any new field added to the structure gets initialized.
This commit is contained in:
parent
6f9b5d1696
commit
2e320d8db5
1 changed files with 1 additions and 1 deletions
|
@ -301,7 +301,7 @@ int eloop_register_timeout(unsigned int secs, unsigned int usecs,
|
|||
{
|
||||
struct eloop_timeout *timeout, *tmp;
|
||||
|
||||
timeout = os_malloc(sizeof(*timeout));
|
||||
timeout = os_zalloc(sizeof(*timeout));
|
||||
if (timeout == NULL)
|
||||
return -1;
|
||||
if (os_get_time(&timeout->time) < 0) {
|
||||
|
|
Loading…
Reference in a new issue