From 2e2e8beacb0c66c7f9f11af00e4df1c936f1ca75 Mon Sep 17 00:00:00 2001 From: fang Date: Mon, 9 Dec 2019 11:49:03 +0800 Subject: [PATCH] solve static check questions --- src/client/src/tscSecondaryMerge.c | 6 ++++-- src/client/src/tscServer.c | 1 + src/client/src/tscSystem.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/client/src/tscSecondaryMerge.c b/src/client/src/tscSecondaryMerge.c index 5eebddca73..737c1342d8 100644 --- a/src/client/src/tscSecondaryMerge.c +++ b/src/client/src/tscSecondaryMerge.c @@ -1314,8 +1314,10 @@ int32_t tscLocalDoReduce(SSqlObj *pSql) { tscTrace("%s call the drop local reducer", __FUNCTION__); tscDestroyLocalReducer(pSql); - pRes->numOfRows = 0; - pRes->row = 0; + if (pRes) { + pRes->numOfRows = 0; + pRes->row = 0; + } return 0; } diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 1805eac38d..ed21a82be1 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -2312,6 +2312,7 @@ int tscBuildCreateTableMsg(SSqlObj *pSql) { size = tscEstimateCreateTableMsgLength(pSql); if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, size)) { tscError("%p failed to malloc for create table msg", pSql); + free(tmpData); return -1; } diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 60b90ac328..2ebd1cfc51 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -230,7 +230,7 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) { return -1; } - if (cfg && cfg && cfg->cfgStatus <= TSDB_CFG_CSTATUS_OPTION) { + if (cfg && cfg->cfgStatus <= TSDB_CFG_CSTATUS_OPTION) { char sep = '.'; if (strlen(tsLocale) == 0) { // locale does not set yet -- GitLab