]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
eloop: Clear timeout data during allocation
authorJouni Malinen <j@w1.fi>
Sun, 10 Jan 2010 19:48:27 +0000 (21:48 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 10 Jan 2010 19:48:27 +0000 (21:48 +0200)
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.

src/utils/eloop.c

index 81843c2540f9934b5dc50fa15ca02695cb79af01..ac9998922541adf91a278e7018a0a6ddc4b154f5 100644 (file)
@@ -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) {