fix(lrucache): return fail if array init failed

This commit is contained in:
Minglei Jin 2024-08-09 16:56:13 +08:00
parent 3b80d46b87
commit 3314a5eaa7
1 changed files with 3 additions and 0 deletions

View File

@ -384,6 +384,9 @@ static LRUStatus taosLRUCacheShardInsertEntry(SLRUCacheShard *shard, SLRUEntry *
bool freeOnFail) {
LRUStatus status = TAOS_LRU_STATUS_OK;
SArray *lastReferenceList = taosArrayInit(16, POINTER_BYTES);
if (!lastReferenceList) {
return TAOS_LRU_STATUS_FAIL;
}
(void)taosThreadMutexLock(&shard->mutex);