提交 c0d80b87 编写于 作者: P Ping Xiao

fix crash issue

上级 d582adfa
......@@ -264,9 +264,12 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) {
snprintf(p, remainLen, "N/A");
} else {
int32_t len;
if (pSql->pSubs != NULL && pSql->subState.states != NULL) {
for (int32_t i = 0; i < pQdesc->numOfSub; ++i) {
SSqlObj* psub = pSql->pSubs[i];
int64_t self = (psub != NULL)? psub->self:0;
len = snprintf(p, remainLen, "[%d]0x%" PRIx64 "(%c) ", i,
pSql->pSubs[i]->self,
self,
pSql->subState.states[i] ? 'C' : 'I');
if (len > remainLen) {
break;
......@@ -274,6 +277,7 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) {
remainLen -= len;
p += len;
}
}
}
pQdesc->numOfSub = htonl(pQdesc->numOfSub);
......
......@@ -1482,8 +1482,6 @@ void tscFreeSqlObj(SSqlObj* pSql) {
tscFreeMetaSqlObj(&pSql->metaRid);
tscFreeMetaSqlObj(&pSql->svgroupRid);
tscFreeSubobj(pSql);
SSqlCmd* pCmd = &pSql->cmd;
int32_t cmd = pCmd->command;
if (cmd < TSDB_SQL_INSERT || cmd == TSDB_SQL_RETRIEVE_GLOBALMERGE || cmd == TSDB_SQL_RETRIEVE_EMPTY_RESULT ||
......@@ -1491,6 +1489,7 @@ void tscFreeSqlObj(SSqlObj* pSql) {
tscRemoveFromSqlList(pSql);
}
tscFreeSubobj(pSql);
pSql->signature = NULL;
pSql->fp = NULL;
tfree(pSql->sqlstr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册