Merge pull request #3109 from taosdata/hotfix/TD-1167-fix-coverity-problem
TD-1167, fix coverity problem about client
This commit is contained in:
commit
77b78376cd
|
@ -1158,8 +1158,9 @@ static int32_t handleArithmeticExpr(SSqlCmd* pCmd, int32_t clauseIndex, int32_t
|
||||||
|
|
||||||
int32_t ret = exprTreeFromSqlExpr(pCmd, &pNode, pItem->pNode, pQueryInfo->exprList, pQueryInfo, colList);
|
int32_t ret = exprTreeFromSqlExpr(pCmd, &pNode, pItem->pNode, pQueryInfo->exprList, pQueryInfo, colList);
|
||||||
if (ret != TSDB_CODE_SUCCESS) {
|
if (ret != TSDB_CODE_SUCCESS) {
|
||||||
tExprTreeDestroy(&pNode, NULL);
|
|
||||||
taosTFree(arithmeticExprStr);
|
taosTFree(arithmeticExprStr);
|
||||||
|
taosArrayDestroy(colList);
|
||||||
|
tExprTreeDestroy(&pNode, NULL);
|
||||||
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
|
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1168,6 +1169,8 @@ static int32_t handleArithmeticExpr(SSqlCmd* pCmd, int32_t clauseIndex, int32_t
|
||||||
SColIndex* pIndex = taosArrayGet(colList, k);
|
SColIndex* pIndex = taosArrayGet(colList, k);
|
||||||
if (pIndex->flag == 1) {
|
if (pIndex->flag == 1) {
|
||||||
taosTFree(arithmeticExprStr);
|
taosTFree(arithmeticExprStr);
|
||||||
|
taosArrayDestroy(colList);
|
||||||
|
tExprTreeDestroy(&pNode, NULL);
|
||||||
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg3);
|
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,6 +158,7 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
|
||||||
|
|
||||||
if (pRsp->killConnection) {
|
if (pRsp->killConnection) {
|
||||||
tscKillConnection(pObj);
|
tscKillConnection(pObj);
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (pRsp->queryId) tscKillQuery(pObj, htonl(pRsp->queryId));
|
if (pRsp->queryId) tscKillQuery(pObj, htonl(pRsp->queryId));
|
||||||
if (pRsp->streamId) tscKillStream(pObj, htonl(pRsp->streamId));
|
if (pRsp->streamId) tscKillStream(pObj, htonl(pRsp->streamId));
|
||||||
|
|
|
@ -684,6 +684,8 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
|
||||||
freeJoinSubqueryObj(pParentSql);
|
freeJoinSubqueryObj(pParentSql);
|
||||||
pParentSql->res.code = code;
|
pParentSql->res.code = code;
|
||||||
tscQueueAsyncRes(pParentSql);
|
tscQueueAsyncRes(pParentSql);
|
||||||
|
taosArrayDestroy(s1);
|
||||||
|
taosArrayDestroy(s2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1296,7 +1298,9 @@ int32_t tscHandleMasterJoinQuery(SSqlObj* pSql) {
|
||||||
tscError("%p tableIndex:%d, failed to allocate join support object, abort further query", pSql, i);
|
tscError("%p tableIndex:%d, failed to allocate join support object, abort further query", pSql, i);
|
||||||
pState->numOfRemain = i;
|
pState->numOfRemain = i;
|
||||||
pSql->res.code = TSDB_CODE_TSC_OUT_OF_MEMORY;
|
pSql->res.code = TSDB_CODE_TSC_OUT_OF_MEMORY;
|
||||||
|
if (0 == i) {
|
||||||
|
taosTFree(pState);
|
||||||
|
}
|
||||||
return pSql->res.code;
|
return pSql->res.code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1304,7 +1308,9 @@ int32_t tscHandleMasterJoinQuery(SSqlObj* pSql) {
|
||||||
if (code != TSDB_CODE_SUCCESS) { // failed to create subquery object, quit query
|
if (code != TSDB_CODE_SUCCESS) { // failed to create subquery object, quit query
|
||||||
tscDestroyJoinSupporter(pSupporter);
|
tscDestroyJoinSupporter(pSupporter);
|
||||||
pSql->res.code = TSDB_CODE_TSC_OUT_OF_MEMORY;
|
pSql->res.code = TSDB_CODE_TSC_OUT_OF_MEMORY;
|
||||||
|
if (0 == i) {
|
||||||
|
taosTFree(pState);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2091,17 +2097,17 @@ void tscBuildResFromSubqueries(SSqlObj *pSql) {
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
tscFetchDatablockFromSubquery(pSql);
|
// tscFetchDatablockFromSubquery(pSql);
|
||||||
if (pRes->code != TSDB_CODE_SUCCESS) {
|
// if (pRes->code != TSDB_CODE_SUCCESS) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSql->res.code == TSDB_CODE_SUCCESS) {
|
// if (pSql->res.code == TSDB_CODE_SUCCESS) {
|
||||||
(*pSql->fp)(pSql->param, pSql, pRes->numOfRows);
|
// (*pSql->fp)(pSql->param, pSql, pRes->numOfRows);
|
||||||
} else {
|
// } else {
|
||||||
tscQueueAsyncRes(pSql);
|
// tscQueueAsyncRes(pSql);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
static void transferNcharData(SSqlObj *pSql, int32_t columnIndex, TAOS_FIELD *pField) {
|
static void transferNcharData(SSqlObj *pSql, int32_t columnIndex, TAOS_FIELD *pField) {
|
||||||
|
|
Loading…
Reference in New Issue