Commit 14afbf36 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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.
parent bf6dc619
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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));