diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h index fb6675fe7c..6c3603b4e0 100644 --- a/source/client/inc/clientInt.h +++ b/source/client/inc/clientInt.h @@ -181,6 +181,7 @@ typedef struct SResultColumn { typedef struct SReqResultInfo { SExecResult execRes; + const char* pRspMsg; const char* pData; TAOS_FIELD* fields; // todo, column names are not needed. TAOS_FIELD* userFields; // the fields info that return to user diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 9f41e4cc11..6c20813118 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -363,6 +363,7 @@ void *createRequest(uint64_t connId, int32_t type, int64_t reqid) { } void doFreeReqResultInfo(SReqResultInfo *pResInfo) { + taosMemoryFreeClear(pResInfo->pRspMsg); taosMemoryFreeClear(pResInfo->length); taosMemoryFreeClear(pResInfo->row); taosMemoryFreeClear(pResInfo->pCol); diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index e1c22fc070..e87e676f08 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -2186,6 +2186,8 @@ int32_t setQueryResultFromRsp(SReqResultInfo* pResultInfo, const SRetrieveTableR return TSDB_CODE_TSC_INTERNAL_ERROR; } + taosMemoryFreeClear(pResultInfo->pRspMsg); + pResultInfo->pRspMsg = (const char*)pRsp; pResultInfo->pData = (void*)pRsp->data; pResultInfo->numOfRows = htobe64(pRsp->numOfRows); pResultInfo->current = 0;