[td-255] fix a memory leak.
This commit is contained in:
parent
a66e65b724
commit
0a3b524229
|
@ -3241,6 +3241,7 @@ static void freeQueryInfoImpl(SQueryInfo* pQueryInfo) {
|
||||||
|
|
||||||
taosArrayDestroy(pQueryInfo->pUpstream);
|
taosArrayDestroy(pQueryInfo->pUpstream);
|
||||||
pQueryInfo->pUpstream = NULL;
|
pQueryInfo->pUpstream = NULL;
|
||||||
|
pQueryInfo->bufLen = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tscClearSubqueryInfo(SSqlCmd* pCmd) {
|
void tscClearSubqueryInfo(SSqlCmd* pCmd) {
|
||||||
|
@ -3661,27 +3662,25 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, __async_cb_func_t
|
||||||
pnCmd->active = pNewQueryInfo;
|
pnCmd->active = pNewQueryInfo;
|
||||||
|
|
||||||
memcpy(&pNewQueryInfo->interval, &pQueryInfo->interval, sizeof(pNewQueryInfo->interval));
|
memcpy(&pNewQueryInfo->interval, &pQueryInfo->interval, sizeof(pNewQueryInfo->interval));
|
||||||
pNewQueryInfo->type = pQueryInfo->type;
|
pNewQueryInfo->type = pQueryInfo->type;
|
||||||
pNewQueryInfo->window = pQueryInfo->window;
|
pNewQueryInfo->window = pQueryInfo->window;
|
||||||
pNewQueryInfo->limit = pQueryInfo->limit;
|
pNewQueryInfo->limit = pQueryInfo->limit;
|
||||||
pNewQueryInfo->slimit = pQueryInfo->slimit;
|
pNewQueryInfo->slimit = pQueryInfo->slimit;
|
||||||
pNewQueryInfo->order = pQueryInfo->order;
|
pNewQueryInfo->order = pQueryInfo->order;
|
||||||
pNewQueryInfo->vgroupLimit = pQueryInfo->vgroupLimit;
|
pNewQueryInfo->tsBuf = NULL;
|
||||||
pNewQueryInfo->tsBuf = NULL;
|
pNewQueryInfo->fillType = pQueryInfo->fillType;
|
||||||
pNewQueryInfo->fillType = pQueryInfo->fillType;
|
pNewQueryInfo->fillVal = NULL;
|
||||||
pNewQueryInfo->fillVal = NULL;
|
pNewQueryInfo->clauseLimit = pQueryInfo->clauseLimit;
|
||||||
|
pNewQueryInfo->prjOffset = pQueryInfo->prjOffset;
|
||||||
pNewQueryInfo->numOfFillVal = 0;
|
pNewQueryInfo->numOfFillVal = 0;
|
||||||
pNewQueryInfo->clauseLimit = pQueryInfo->clauseLimit;
|
pNewQueryInfo->numOfTables = 0;
|
||||||
pNewQueryInfo->prjOffset = pQueryInfo->prjOffset;
|
|
||||||
pNewQueryInfo->numOfTables = 0;
|
|
||||||
pNewQueryInfo->pTableMetaInfo = NULL;
|
pNewQueryInfo->pTableMetaInfo = NULL;
|
||||||
pNewQueryInfo->bufLen = pQueryInfo->bufLen;
|
pNewQueryInfo->bufLen = pQueryInfo->bufLen;
|
||||||
pNewQueryInfo->buf = malloc(pQueryInfo->bufLen);
|
pNewQueryInfo->vgroupLimit = pQueryInfo->vgroupLimit;
|
||||||
|
pNewQueryInfo->distinct = pQueryInfo->distinct;
|
||||||
pNewQueryInfo->distinct = pQueryInfo->distinct;
|
|
||||||
pNewQueryInfo->multigroupResult = pQueryInfo->multigroupResult;
|
pNewQueryInfo->multigroupResult = pQueryInfo->multigroupResult;
|
||||||
|
|
||||||
pNewQueryInfo->buf = malloc(pQueryInfo->bufLen);
|
pNewQueryInfo->buf = malloc(pQueryInfo->bufLen);
|
||||||
if (pNewQueryInfo->buf == NULL) {
|
if (pNewQueryInfo->buf == NULL) {
|
||||||
terrno = TSDB_CODE_TSC_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_TSC_OUT_OF_MEMORY;
|
||||||
goto _error;
|
goto _error;
|
||||||
|
|
|
@ -165,6 +165,8 @@ char *strnchr(char *haystack, char needle, int32_t len, bool skipquote) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
char* strtolower(char *dst, const char *src) {
|
char* strtolower(char *dst, const char *src) {
|
||||||
int esc = 0;
|
int esc = 0;
|
||||||
char quote = 0, *p = dst, c;
|
char quote = 0, *p = dst, c;
|
||||||
|
|
Loading…
Reference in New Issue