Merge pull request #27407 from taosdata/fix/TD-31620

fix: check the result of array init
This commit is contained in:
dapan1121 2024-08-23 10:48:31 +08:00 committed by GitHub
commit 4f5b2071b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -1168,6 +1168,10 @@ void cleanupExpiredUdfs() {
void cleanupNotExpiredUdfs() { void cleanupNotExpiredUdfs() {
SArray *udfStubs = taosArrayInit(16, sizeof(SUdfcFuncStub)); SArray *udfStubs = taosArrayInit(16, sizeof(SUdfcFuncStub));
if (udfStubs == NULL) {
fnError("cleanupNotExpiredUdfs: failed to init array");
return;
}
int32_t i = 0; int32_t i = 0;
while (i < taosArrayGetSize(gUdfcProxy.udfStubs)) { while (i < taosArrayGetSize(gUdfcProxy.udfStubs)) {
SUdfcFuncStub *stub = taosArrayGet(gUdfcProxy.udfStubs, i); SUdfcFuncStub *stub = taosArrayGet(gUdfcProxy.udfStubs, i);