diff --git a/external/util/include/util/llsort.h b/external/util/include/util/llsort.h index 5694115..b285a52 100644 --- a/external/util/include/util/llsort.h +++ b/external/util/include/util/llsort.h @@ -121,7 +121,8 @@ * and q has too */ \ _p = _q; \ } \ - _tail->next = NULL; \ + if (_tail) \ + _tail->next = NULL; \ /* If we have done only one merge, we're finished. */ \ if (_nmerges <= 1) { \ /* allow for nmerges == 0, the empty list case */ \