fix:[TD-31017]process return value in clientRawBlockWrite.c

This commit is contained in:
wangmm0220 2024-07-19 18:36:51 +08:00
parent 195fe9b6cc
commit 08440d1ab7
1 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,7 @@
#define RAW_RETURN_CHECK(c) \ #define RAW_RETURN_CHECK(c) \
do { \ do { \
code == c; \ code = c; \
if (code != 0) { \ if (code != 0) { \
goto end; \ goto end; \
} \ } \
@ -1949,12 +1949,13 @@ static void processBatchMetaToJson(SMqBatchMetaRsp* pMsgRsp, char** string) {
SDecoder coder; SDecoder coder;
SMqBatchMetaRsp rsp = {0}; SMqBatchMetaRsp rsp = {0};
int32_t code = 0; int32_t code = 0;
cJSON* pJson = NULL;
tDecoderInit(&coder, pMsgRsp->pMetaBuff, pMsgRsp->metaBuffLen); tDecoderInit(&coder, pMsgRsp->pMetaBuff, pMsgRsp->metaBuffLen);
if (tDecodeMqBatchMetaRsp(&coder, &rsp) < 0) { if (tDecodeMqBatchMetaRsp(&coder, &rsp) < 0) {
goto end; goto end;
} }
cJSON* pJson = cJSON_CreateObject(); pJson = cJSON_CreateObject();
RAW_NULL_CHECK(pJson); RAW_NULL_CHECK(pJson);
RAW_FALSE_CHECK(cJSON_AddStringToObject(pJson, "tmq_meta_version", TMQ_META_VERSION)); RAW_FALSE_CHECK(cJSON_AddStringToObject(pJson, "tmq_meta_version", TMQ_META_VERSION));
cJSON* pMetaArr = cJSON_CreateArray(); cJSON* pMetaArr = cJSON_CreateArray();
@ -1982,6 +1983,7 @@ static void processBatchMetaToJson(SMqBatchMetaRsp* pMsgRsp, char** string) {
char* fullStr = cJSON_PrintUnformatted(pJson); char* fullStr = cJSON_PrintUnformatted(pJson);
cJSON_Delete(pJson); cJSON_Delete(pJson);
*string = fullStr; *string = fullStr;
return;
end: end:
cJSON_Delete(pJson); cJSON_Delete(pJson);