diff --git a/src/util/src/tskiplist.c b/src/util/src/tskiplist.c index 20bec169546d6514def2453257346d5f94826187..7c950b7999b627d9334eae37eab35e1796c804dc 100644 --- a/src/util/src/tskiplist.c +++ b/src/util/src/tskiplist.c @@ -280,7 +280,10 @@ bool tSkipListIterNext(SSkipListIterator *iter) { tSkipListRLock(pSkipList); if (iter->order == TSDB_ORDER_ASC) { - if (iter->cur == pSkipList->pTail) return false; + if (iter->cur == pSkipList->pTail) { + tSkipListUnlock(pSkipList); + return false; + } iter->cur = SL_NODE_GET_FORWARD_POINTER(iter->cur, 0); // a new node is inserted into between iter->cur and iter->next, ignore it