Merge pull request #27128 from taosdata/fix/TD-31325

fix(lrucache): return fail if array init failed
This commit is contained in:
Hongze Cheng 2024-08-12 13:57:10 +08:00 committed by GitHub
commit 600d1b2c64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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);