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:
commit
1fb578df10
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue