Merge pull request #27610 from taosdata/fix/TD-31835-3.0

fix: possible memory leak when error occurs in thash.c
This commit is contained in:
Hongze Cheng 2024-09-02 19:09:34 +08:00 committed by GitHub
commit 1fb578df10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -285,6 +285,7 @@ SHashObj *taosHashInit(size_t capacity, _hash_fn_t fn, bool update, SHashLockTyp
}
if (taosArrayPush(pHashObj->pMemBlock, &p) == NULL) {
taosMemoryFree(p);
taosArrayDestroy(pHashObj->pMemBlock);
taosMemoryFree(pHashObj->hashList);
taosMemoryFree(pHashObj);