[TD-2805]<fix>: null pointer checking

This commit is contained in:
Minglei Jin 2021-01-21 18:25:20 +08:00
parent 71ab0a62eb
commit db1be4f69d
1 changed files with 3 additions and 0 deletions

View File

@ -50,6 +50,9 @@ int32_t mnodeProcessRead(SMnodeMsg *pMsg) {
if (!sdbIsMaster()) {
SMnodeRsp *rpcRsp = &pMsg->rpcRsp;
SRpcEpSet *epSet = rpcMallocCont(sizeof(SRpcEpSet));
if (!epSet) {
return TSDB_CODE_MND_OUT_OF_MEMORY;
}
mnodeGetMnodeEpSetForShell(epSet, true);
rpcRsp->rsp = epSet;
rpcRsp->len = sizeof(SRpcEpSet);