Merge pull request #27902 from taosdata/fix/memoryAllocCheck

Fix: memory alloc check
This commit is contained in:
Pan Wei 2024-09-18 08:55:41 +08:00 committed by GitHub
commit eb32a41c29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 0 deletions

View File

@ -3710,6 +3710,9 @@ int32_t ctgGetTbHashVgroupFromCache(SCatalog *pCtg, const SName *pTableName, SVg
}
*pVgroup = taosMemoryCalloc(1, sizeof(SVgroupInfo));
if (NULL == *pVgroup) {
CTG_ERR_JRET(terrno);
}
CTG_ERR_JRET(ctgGetVgInfoFromHashValue(pCtg, NULL, dbCache->vgCache.vgInfo, pTableName, *pVgroup));
_return:

View File

@ -291,6 +291,10 @@ int32_t ctgdHandleDbgCommand(char *command) {
}
char *dup = taosStrdup(command);
if (NULL == dup) {
CTG_RET(terrno);
}
char *option = NULL;
char *param = NULL;

View File

@ -149,6 +149,9 @@ int32_t mJoinTrimKeepOneRow(SSDataBlock* pBlock, int32_t totalRows, const bool*
len = varDataTLen(p1);
}
char* p2 = taosMemoryMalloc(len);
if (NULL == p2) {
MJ_ERR_RET(terrno);
}
TAOS_MEMCPY(p2, p1, len);
code = colDataSetVal(pDst, numOfRows, p2, false);
if (code) {

View File

@ -267,6 +267,9 @@ int32_t schProcessResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SD
if (pMsg->pData) {
SDecoder coder = {0};
SSubmitRsp2 *rsp = taosMemoryMalloc(sizeof(*rsp));
if (NULL == rsp) {
SCH_ERR_JRET(terrno);
}
tDecoderInit(&coder, pMsg->pData, msgSize);
code = tDecodeSSubmitRsp2(&coder, rsp);
tDecoderClear(&coder);
@ -957,6 +960,9 @@ int32_t schUpdateSendTargetInfo(SMsgSendInfo *pMsgSendInfo, SQueryNodeAddr *addr
pMsgSendInfo->target.type = TARGET_TYPE_VNODE;
pMsgSendInfo->target.vgId = addr->nodeId;
pMsgSendInfo->target.dbFName = taosStrdup(pTask->plan->dbFName);
if (NULL == pMsgSendInfo->target.dbFName) {
return terrno;
}
}
return TSDB_CODE_SUCCESS;