check return code

This commit is contained in:
yihaoDeng 2024-09-26 15:23:49 +08:00
parent 93ecc3a6c4
commit 67b0e076bd
1 changed files with 12 additions and 1 deletions

View File

@ -174,7 +174,18 @@ FAutoCtx* automCtxCreate(void* data, AutomationType atype) {
// add more search type
}
ctx->data = (data != NULL ? taosStrdup((char*)data) : NULL);
// ctx->data = (data != NULL ? taosStrdup((char*)data) : NULL);
if (data != NULL) {
ctx->data = taosStrdup((char*)data);
if (ctx->data == NULL) {
startWithStateValueDestroy(sv);
taosMemoryFree(ctx);
return NULL;
}
} else {
ctx->data = NULL;
}
ctx->type = atype;
ctx->stdata = (void*)sv;
return ctx;