fix: coverity scan problem
This commit is contained in:
parent
c58daa705b
commit
cc455b9903
|
@ -354,14 +354,14 @@ static int32_t tsdbRemoveFileSet(STsdb *pTsdb, SDFileSet *pSet) {
|
||||||
nRef = atomic_sub_fetch_32(&pSet->pDataF->nRef, 1);
|
nRef = atomic_sub_fetch_32(&pSet->pDataF->nRef, 1);
|
||||||
if (nRef == 0) {
|
if (nRef == 0) {
|
||||||
tsdbDataFileName(pTsdb, pSet->diskId, pSet->fid, pSet->pDataF, fname);
|
tsdbDataFileName(pTsdb, pSet->diskId, pSet->fid, pSet->pDataF, fname);
|
||||||
taosRemoveFile(fname);
|
(void)taosRemoveFile(fname);
|
||||||
taosMemoryFree(pSet->pDataF);
|
taosMemoryFree(pSet->pDataF);
|
||||||
}
|
}
|
||||||
|
|
||||||
nRef = atomic_sub_fetch_32(&pSet->pSmaF->nRef, 1);
|
nRef = atomic_sub_fetch_32(&pSet->pSmaF->nRef, 1);
|
||||||
if (nRef == 0) {
|
if (nRef == 0) {
|
||||||
tsdbSmaFileName(pTsdb, pSet->diskId, pSet->fid, pSet->pSmaF, fname);
|
tsdbSmaFileName(pTsdb, pSet->diskId, pSet->fid, pSet->pSmaF, fname);
|
||||||
taosRemoveFile(fname);
|
(void)taosRemoveFile(fname);
|
||||||
taosMemoryFree(pSet->pSmaF);
|
taosMemoryFree(pSet->pSmaF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ static int32_t tsdbRemoveFileSet(STsdb *pTsdb, SDFileSet *pSet) {
|
||||||
nRef = atomic_sub_fetch_32(&pSet->aSttF[iStt]->nRef, 1);
|
nRef = atomic_sub_fetch_32(&pSet->aSttF[iStt]->nRef, 1);
|
||||||
if (nRef == 0) {
|
if (nRef == 0) {
|
||||||
tsdbSttFileName(pTsdb, pSet->diskId, pSet->fid, pSet->aSttF[iStt], fname);
|
tsdbSttFileName(pTsdb, pSet->diskId, pSet->fid, pSet->aSttF[iStt], fname);
|
||||||
taosRemoveFile(fname);
|
(void)taosRemoveFile(fname);
|
||||||
taosMemoryFree(pSet->aSttF[iStt]);
|
taosMemoryFree(pSet->aSttF[iStt]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -526,7 +526,7 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe
|
||||||
nRef = atomic_sub_fetch_32(&pSttFile->nRef, 1);
|
nRef = atomic_sub_fetch_32(&pSttFile->nRef, 1);
|
||||||
if (nRef == 0) {
|
if (nRef == 0) {
|
||||||
tsdbSttFileName(pTsdb, pSetOld->diskId, pSetOld->fid, pSttFile, fname);
|
tsdbSttFileName(pTsdb, pSetOld->diskId, pSetOld->fid, pSttFile, fname);
|
||||||
taosRemoveFile(fname);
|
(void)taosRemoveFile(fname);
|
||||||
taosMemoryFree(pSttFile);
|
taosMemoryFree(pSttFile);
|
||||||
}
|
}
|
||||||
pSetOld->aSttF[iStt] = NULL;
|
pSetOld->aSttF[iStt] = NULL;
|
||||||
|
@ -547,7 +547,7 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe
|
||||||
nRef = atomic_sub_fetch_32(&pSttFile->nRef, 1);
|
nRef = atomic_sub_fetch_32(&pSttFile->nRef, 1);
|
||||||
if (nRef == 0) {
|
if (nRef == 0) {
|
||||||
tsdbSttFileName(pTsdb, pSetOld->diskId, pSetOld->fid, pSttFile, fname);
|
tsdbSttFileName(pTsdb, pSetOld->diskId, pSetOld->fid, pSttFile, fname);
|
||||||
taosRemoveFile(fname);
|
(void)taosRemoveFile(fname);
|
||||||
taosMemoryFree(pSttFile);
|
taosMemoryFree(pSttFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1102,7 +1102,7 @@ void tsdbFSUnref(STsdb *pTsdb, STsdbFS *pFS) {
|
||||||
ASSERT(nRef >= 0);
|
ASSERT(nRef >= 0);
|
||||||
if (nRef == 0) {
|
if (nRef == 0) {
|
||||||
tsdbDataFileName(pTsdb, pSet->diskId, pSet->fid, pSet->pDataF, fname);
|
tsdbDataFileName(pTsdb, pSet->diskId, pSet->fid, pSet->pDataF, fname);
|
||||||
taosRemoveFile(fname);
|
(void)taosRemoveFile(fname);
|
||||||
taosMemoryFree(pSet->pDataF);
|
taosMemoryFree(pSet->pDataF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1111,7 +1111,7 @@ void tsdbFSUnref(STsdb *pTsdb, STsdbFS *pFS) {
|
||||||
ASSERT(nRef >= 0);
|
ASSERT(nRef >= 0);
|
||||||
if (nRef == 0) {
|
if (nRef == 0) {
|
||||||
tsdbSmaFileName(pTsdb, pSet->diskId, pSet->fid, pSet->pSmaF, fname);
|
tsdbSmaFileName(pTsdb, pSet->diskId, pSet->fid, pSet->pSmaF, fname);
|
||||||
taosRemoveFile(fname);
|
(void)taosRemoveFile(fname);
|
||||||
taosMemoryFree(pSet->pSmaF);
|
taosMemoryFree(pSet->pSmaF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1121,7 +1121,7 @@ void tsdbFSUnref(STsdb *pTsdb, STsdbFS *pFS) {
|
||||||
ASSERT(nRef >= 0);
|
ASSERT(nRef >= 0);
|
||||||
if (nRef == 0) {
|
if (nRef == 0) {
|
||||||
tsdbSttFileName(pTsdb, pSet->diskId, pSet->fid, pSet->aSttF[iStt], fname);
|
tsdbSttFileName(pTsdb, pSet->diskId, pSet->fid, pSet->aSttF[iStt], fname);
|
||||||
taosRemoveFile(fname);
|
(void)taosRemoveFile(fname);
|
||||||
taosMemoryFree(pSet->aSttF[iStt]);
|
taosMemoryFree(pSet->aSttF[iStt]);
|
||||||
/* code */
|
/* code */
|
||||||
}
|
}
|
||||||
|
|
|
@ -1334,8 +1334,8 @@ int32_t tsdbDelFWriterOpen(SDelFWriter **ppWriter, SDelFile *pFile, STsdb *pTsdb
|
||||||
_exit:
|
_exit:
|
||||||
if (code) {
|
if (code) {
|
||||||
if (pDelFWriter) {
|
if (pDelFWriter) {
|
||||||
taosMemoryFree(pDelFWriter);
|
|
||||||
tsdbCloseFile(&pDelFWriter->pWriteH);
|
tsdbCloseFile(&pDelFWriter->pWriteH);
|
||||||
|
taosMemoryFree(pDelFWriter);
|
||||||
}
|
}
|
||||||
*ppWriter = NULL;
|
*ppWriter = NULL;
|
||||||
tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(errno));
|
tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(errno));
|
||||||
|
|
|
@ -517,8 +517,8 @@ int32_t tsdbSnapReaderOpen(STsdb* pTsdb, int64_t sver, int64_t ever, int8_t type
|
||||||
|
|
||||||
_exit:
|
_exit:
|
||||||
if (code) {
|
if (code) {
|
||||||
tsdbError("vgId:%d %s failed at line %d since %s, TSDB path: %s", TD_VID(pTsdb->pVnode), lino, tstrerror(code),
|
tsdbError("vgId:%d %s failed at line %d since %s, TSDB path: %s", TD_VID(pTsdb->pVnode), __func__, lino,
|
||||||
pTsdb->path);
|
tstrerror(code), pTsdb->path);
|
||||||
*ppReader = NULL;
|
*ppReader = NULL;
|
||||||
|
|
||||||
if (pReader) {
|
if (pReader) {
|
||||||
|
|
|
@ -53,7 +53,10 @@ int32_t vnodePreProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg) {
|
||||||
for (int32_t iReq = 0; iReq < nReqs; iReq++) {
|
for (int32_t iReq = 0; iReq < nReqs; iReq++) {
|
||||||
tb_uid_t uid = tGenIdPI64();
|
tb_uid_t uid = tGenIdPI64();
|
||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
tStartDecode(&dc);
|
if (tStartDecode(&dc) < 0) {
|
||||||
|
code = TSDB_CODE_INVALID_MSG;
|
||||||
|
goto _err;
|
||||||
|
}
|
||||||
|
|
||||||
if (tDecodeI32v(&dc, NULL) < 0) {
|
if (tDecodeI32v(&dc, NULL) < 0) {
|
||||||
code = TSDB_CODE_INVALID_MSG;
|
code = TSDB_CODE_INVALID_MSG;
|
||||||
|
|
Loading…
Reference in New Issue