fix:memory leak
This commit is contained in:
parent
bb80866395
commit
93f71923d7
|
@ -181,6 +181,7 @@ typedef struct SResultColumn {
|
||||||
|
|
||||||
typedef struct SReqResultInfo {
|
typedef struct SReqResultInfo {
|
||||||
SExecResult execRes;
|
SExecResult execRes;
|
||||||
|
const char* pRspMsg;
|
||||||
const char* pData;
|
const char* pData;
|
||||||
TAOS_FIELD* fields; // todo, column names are not needed.
|
TAOS_FIELD* fields; // todo, column names are not needed.
|
||||||
TAOS_FIELD* userFields; // the fields info that return to user
|
TAOS_FIELD* userFields; // the fields info that return to user
|
||||||
|
|
|
@ -363,6 +363,7 @@ void *createRequest(uint64_t connId, int32_t type, int64_t reqid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void doFreeReqResultInfo(SReqResultInfo *pResInfo) {
|
void doFreeReqResultInfo(SReqResultInfo *pResInfo) {
|
||||||
|
taosMemoryFreeClear(pResInfo->pRspMsg);
|
||||||
taosMemoryFreeClear(pResInfo->length);
|
taosMemoryFreeClear(pResInfo->length);
|
||||||
taosMemoryFreeClear(pResInfo->row);
|
taosMemoryFreeClear(pResInfo->row);
|
||||||
taosMemoryFreeClear(pResInfo->pCol);
|
taosMemoryFreeClear(pResInfo->pCol);
|
||||||
|
|
|
@ -2186,6 +2186,8 @@ int32_t setQueryResultFromRsp(SReqResultInfo* pResultInfo, const SRetrieveTableR
|
||||||
return TSDB_CODE_TSC_INTERNAL_ERROR;
|
return TSDB_CODE_TSC_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taosMemoryFreeClear(pResultInfo->pRspMsg);
|
||||||
|
pResultInfo->pRspMsg = (const char*)pRsp;
|
||||||
pResultInfo->pData = (void*)pRsp->data;
|
pResultInfo->pData = (void*)pRsp->data;
|
||||||
pResultInfo->numOfRows = htobe64(pRsp->numOfRows);
|
pResultInfo->numOfRows = htobe64(pRsp->numOfRows);
|
||||||
pResultInfo->current = 0;
|
pResultInfo->current = 0;
|
||||||
|
|
Loading…
Reference in New Issue