From 3fb4dbbec4d848c64e20febbd5d00b7290405faf Mon Sep 17 00:00:00 2001 From: xsren <285808407@qq.com> Date: Thu, 22 Aug 2024 17:12:14 +0800 Subject: [PATCH] fix: check the result of array init --- source/libs/function/src/tudf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index d5ecf09cee..44b6ba4722 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -1168,6 +1168,10 @@ void cleanupExpiredUdfs() { void cleanupNotExpiredUdfs() { SArray *udfStubs = taosArrayInit(16, sizeof(SUdfcFuncStub)); + if (udfStubs == NULL) { + fnError("cleanupNotExpiredUdfs: failed to init array"); + return; + } int32_t i = 0; while (i < taosArrayGetSize(gUdfcProxy.udfStubs)) { SUdfcFuncStub *stub = taosArrayGet(gUdfcProxy.udfStubs, i);