From 1add9ded8d2b0c579a8e32329ea4554cdce97e69 Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 18 Sep 2024 23:19:00 +0800 Subject: [PATCH] enh: check memory allocation --- source/util/src/tcache.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/util/src/tcache.c b/source/util/src/tcache.c index 40d282efb9..81e50f6a6b 100644 --- a/source/util/src/tcache.c +++ b/source/util/src/tcache.c @@ -366,7 +366,7 @@ SCacheObj *taosCacheInit(int32_t keyType, int64_t refreshTimeInMs, bool extendLi SCacheObj *pCacheObj = (SCacheObj *)taosMemoryCalloc(1, sizeof(SCacheObj)); if (pCacheObj == NULL) { - uError("failed to allocate memory, reason:%s", terrstr()); + uError("failed to allocate memory, reason:%s", strerror(errno)); terrno = TSDB_CODE_OUT_OF_MEMORY; return NULL; } @@ -404,7 +404,6 @@ SCacheObj *taosCacheInit(int32_t keyType, int64_t refreshTimeInMs, bool extendLi return NULL; } - (void)doRegisterCacheObj(pCacheObj); return pCacheObj; }