fix:memory leak

This commit is contained in:
wangmm0220 2024-03-08 15:47:53 +08:00
parent bb80866395
commit 93f71923d7
3 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;