fix: malloc failed in thash.c

This commit is contained in:
Hongze Cheng 2024-08-06 17:29:20 +08:00
parent 1bb5d787ba
commit 84a4921478
1 changed files with 3 additions and 0 deletions

View File

@ -624,6 +624,9 @@ void taosHashTableResize(SHashObj *pHashObj) {
size_t inc = newCapacity - pHashObj->capacity;
void *p = taosMemoryCalloc(inc, sizeof(SHashEntry));
if (p == NULL) {
return;
}
for (int32_t i = 0; i < inc; ++i) {
pHashObj->hashList[i + pHashObj->capacity] = (void *)((char *)p + i * sizeof(SHashEntry));