fix mem leak
This commit is contained in:
parent
f85b81e056
commit
176af30aec
|
@ -52,6 +52,8 @@ int tsInsertInitialCheck(SSqlObj *pSql);
|
|||
|
||||
void doCleanupSubqueries(SSqlObj *pSql, int32_t numOfSubs);
|
||||
|
||||
void tscFreeRetrieveSupporters(SSqlObj *pSql);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -2050,6 +2050,19 @@ void doCleanupSubqueries(SSqlObj *pSql, int32_t numOfSubs) {
|
|||
}
|
||||
}
|
||||
|
||||
void tscFreeRetrieveSupporters(SSqlObj *pSql) {
|
||||
for(int32_t i = 0; i < pSql->subState.numOfSub; ++i) {
|
||||
SSqlObj* pSub = pSql->pSubs[i];
|
||||
assert(pSub != NULL);
|
||||
|
||||
SRetrieveSupport* pSupport = pSub->param;
|
||||
|
||||
tfree(pSupport->localBuffer);
|
||||
tfree(pSub->param);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void tscLockByThread(int64_t *lockedBy) {
|
||||
int64_t tid = taosGetSelfPthreadId();
|
||||
int i = 0;
|
||||
|
@ -2731,6 +2744,8 @@ void tscHandleSubqueryError(SRetrieveSupport *trsupport, SSqlObj *pSql, int numO
|
|||
|
||||
SSqlObj *userSql = ((SRetrieveSupport*)pParentSql->param)->pParentSql;
|
||||
|
||||
tscFreeRetrieveSupporters(pParentSql);
|
||||
|
||||
tscFreeSubobj(userSql);
|
||||
tfree(userSql->pSubs);
|
||||
|
||||
|
|
|
@ -3767,6 +3767,8 @@ static void tscSubqueryCompleteCallback(void* param, TAOS_RES* tres, int code) {
|
|||
|
||||
SSqlObj *userSql = ((SRetrieveSupport*)pParentSql->param)->pParentSql;
|
||||
|
||||
tscFreeRetrieveSupporters(pParentSql);
|
||||
|
||||
tscFreeSubobj(userSql);
|
||||
tfree(userSql->pSubs);
|
||||
|
||||
|
|
Loading…
Reference in New Issue