From 84a49214786d2f525d78dd26b1b93dc027712ae7 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Tue, 6 Aug 2024 17:29:20 +0800 Subject: [PATCH] fix: malloc failed in thash.c --- source/util/src/thash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/util/src/thash.c b/source/util/src/thash.c index 2daedfdf32..5c1909b16e 100644 --- a/source/util/src/thash.c +++ b/source/util/src/thash.c @@ -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));