fix: add memory alloc validation
This commit is contained in:
parent
fcf39a444a
commit
1ccc74d768
|
@ -3710,6 +3710,9 @@ int32_t ctgGetTbHashVgroupFromCache(SCatalog *pCtg, const SName *pTableName, SVg
|
||||||
}
|
}
|
||||||
|
|
||||||
*pVgroup = taosMemoryCalloc(1, sizeof(SVgroupInfo));
|
*pVgroup = taosMemoryCalloc(1, sizeof(SVgroupInfo));
|
||||||
|
if (NULL == *pVgroup) {
|
||||||
|
CTG_ERR_JRET(terrno);
|
||||||
|
}
|
||||||
CTG_ERR_JRET(ctgGetVgInfoFromHashValue(pCtg, NULL, dbCache->vgCache.vgInfo, pTableName, *pVgroup));
|
CTG_ERR_JRET(ctgGetVgInfoFromHashValue(pCtg, NULL, dbCache->vgCache.vgInfo, pTableName, *pVgroup));
|
||||||
|
|
||||||
_return:
|
_return:
|
||||||
|
|
|
@ -291,6 +291,10 @@ int32_t ctgdHandleDbgCommand(char *command) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char *dup = taosStrdup(command);
|
char *dup = taosStrdup(command);
|
||||||
|
if (NULL == dup) {
|
||||||
|
CTG_RET(terrno);
|
||||||
|
}
|
||||||
|
|
||||||
char *option = NULL;
|
char *option = NULL;
|
||||||
char *param = NULL;
|
char *param = NULL;
|
||||||
|
|
||||||
|
|
|
@ -149,6 +149,9 @@ int32_t mJoinTrimKeepOneRow(SSDataBlock* pBlock, int32_t totalRows, const bool*
|
||||||
len = varDataTLen(p1);
|
len = varDataTLen(p1);
|
||||||
}
|
}
|
||||||
char* p2 = taosMemoryMalloc(len);
|
char* p2 = taosMemoryMalloc(len);
|
||||||
|
if (NULL == p2) {
|
||||||
|
MJ_ERR_RET(terrno);
|
||||||
|
}
|
||||||
TAOS_MEMCPY(p2, p1, len);
|
TAOS_MEMCPY(p2, p1, len);
|
||||||
code = colDataSetVal(pDst, numOfRows, p2, false);
|
code = colDataSetVal(pDst, numOfRows, p2, false);
|
||||||
if (code) {
|
if (code) {
|
||||||
|
|
|
@ -267,6 +267,9 @@ int32_t schProcessResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SD
|
||||||
if (pMsg->pData) {
|
if (pMsg->pData) {
|
||||||
SDecoder coder = {0};
|
SDecoder coder = {0};
|
||||||
SSubmitRsp2 *rsp = taosMemoryMalloc(sizeof(*rsp));
|
SSubmitRsp2 *rsp = taosMemoryMalloc(sizeof(*rsp));
|
||||||
|
if (NULL == rsp) {
|
||||||
|
SCH_ERR_JRET(terrno);
|
||||||
|
}
|
||||||
tDecoderInit(&coder, pMsg->pData, msgSize);
|
tDecoderInit(&coder, pMsg->pData, msgSize);
|
||||||
code = tDecodeSSubmitRsp2(&coder, rsp);
|
code = tDecodeSSubmitRsp2(&coder, rsp);
|
||||||
tDecoderClear(&coder);
|
tDecoderClear(&coder);
|
||||||
|
@ -957,6 +960,9 @@ int32_t schUpdateSendTargetInfo(SMsgSendInfo *pMsgSendInfo, SQueryNodeAddr *addr
|
||||||
pMsgSendInfo->target.type = TARGET_TYPE_VNODE;
|
pMsgSendInfo->target.type = TARGET_TYPE_VNODE;
|
||||||
pMsgSendInfo->target.vgId = addr->nodeId;
|
pMsgSendInfo->target.vgId = addr->nodeId;
|
||||||
pMsgSendInfo->target.dbFName = taosStrdup(pTask->plan->dbFName);
|
pMsgSendInfo->target.dbFName = taosStrdup(pTask->plan->dbFName);
|
||||||
|
if (NULL == pMsgSendInfo->target.dbFName) {
|
||||||
|
return terrno;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue