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.
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));