mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 15:48:49 -05:00
add_next_timeout: minor restructure of code
By reading the ->head pointer and using that instead of the ->size number to figure out if there's a list remaining we avoid the (false positive) clang-analyzer warning that we might dereference of a null pointer.
This commit is contained in:
parent
bf6dc61967
commit
14afbf361a
@ -2079,14 +2079,14 @@ static CURLMcode add_next_timeout(struct timeval now,
|
||||
break;
|
||||
e = n;
|
||||
}
|
||||
if(!list->size) {
|
||||
e = list->head;
|
||||
if(!e) {
|
||||
/* clear the expire times within the handles that we remove from the
|
||||
splay tree */
|
||||
tv->tv_sec = 0;
|
||||
tv->tv_usec = 0;
|
||||
}
|
||||
else {
|
||||
e = list->head;
|
||||
/* copy the first entry to 'tv' */
|
||||
memcpy(tv, e->ptr, sizeof(*tv));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user