diff options
author | Daniel Stenberg <daniel@haxx.se> | 2012-08-08 14:50:32 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2012-08-08 14:50:32 +0200 |
commit | 14afbf361a4fbce8153d98dba4145e5693a92e98 (patch) | |
tree | a138de656fa88c30dbf1735a762d52af433d36f7 /lib | |
parent | bf6dc61967c044e2d4fb695f651a8c728c421cb6 (diff) |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/multi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/multi.c b/lib/multi.c index ff43378f5..d252351b7 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -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)); |