提交 e6b40314 编写于 作者: S Shengliang Guan

fix: coverity issues

上级 48adbf6e
...@@ -201,12 +201,14 @@ static SSdbRow *mndSmaActionDecode(SSdbRaw *pRaw) { ...@@ -201,12 +201,14 @@ static SSdbRow *mndSmaActionDecode(SSdbRaw *pRaw) {
terrno = 0; terrno = 0;
_OVER: _OVER:
if (terrno != 0 && pSma != NULL) { if (terrno != 0) {
mError("sma:%s, failed to decode from raw:%p since %s", pSma->name, pRaw, terrstr()); if (pSma != NULL) {
taosMemoryFreeClear(pSma->expr); mError("sma:%s, failed to decode from raw:%p since %s", pSma->name, pRaw, terrstr());
taosMemoryFreeClear(pSma->tagsFilter); taosMemoryFreeClear(pSma->expr);
taosMemoryFreeClear(pSma->sql); taosMemoryFreeClear(pSma->tagsFilter);
taosMemoryFreeClear(pSma->ast); taosMemoryFreeClear(pSma->sql);
taosMemoryFreeClear(pSma->ast);
}
taosMemoryFreeClear(pRow); taosMemoryFreeClear(pRow);
return NULL; return NULL;
} }
......
...@@ -271,6 +271,11 @@ SSyncFSM *mndSyncMakeFsm(SMnode *pMnode) { ...@@ -271,6 +271,11 @@ SSyncFSM *mndSyncMakeFsm(SMnode *pMnode) {
int32_t mndInitSync(SMnode *pMnode) { int32_t mndInitSync(SMnode *pMnode) {
SSyncMgmt *pMgmt = &pMnode->syncMgmt; SSyncMgmt *pMgmt = &pMnode->syncMgmt;
taosThreadMutexInit(&pMgmt->lock, NULL); taosThreadMutexInit(&pMgmt->lock, NULL);
taosThreadMutexLock(&pMgmt->lock);
pMgmt->transId = 0;
pMgmt->transSec = 0;
pMgmt->transSeq = 0;
taosThreadMutexUnlock(&pMgmt->lock);
SSyncInfo syncInfo = { SSyncInfo syncInfo = {
.snapshotStrategy = SYNC_STRATEGY_STANDARD_SNAPSHOT, .snapshotStrategy = SYNC_STRATEGY_STANDARD_SNAPSHOT,
......
...@@ -227,8 +227,8 @@ STaosQueue *tAutoQWorkerAllocQueue(SAutoQWorkerPool *pool, void *ahandle, FItem ...@@ -227,8 +227,8 @@ STaosQueue *tAutoQWorkerAllocQueue(SAutoQWorkerPool *pool, void *ahandle, FItem
uError("worker:%s:%d failed to create", pool->name, curWorkerNum); uError("worker:%s:%d failed to create", pool->name, curWorkerNum);
taosMemoryFree(worker); taosMemoryFree(worker);
taosCloseQueue(queue); taosCloseQueue(queue);
terrno = TSDB_CODE_OUT_OF_MEMORY;
taosThreadMutexUnlock(&pool->mutex); taosThreadMutexUnlock(&pool->mutex);
terrno = TSDB_CODE_OUT_OF_MEMORY;
return NULL; return NULL;
} }
worker->id = curWorkerNum; worker->id = curWorkerNum;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册