fix return value check problem
This commit is contained in:
parent
24b5da8bf4
commit
afc3525477
|
@ -1188,12 +1188,12 @@ static int tsdbMoveBlock(SCommitH *pCommith, int bidx) {
|
|||
}
|
||||
|
||||
static int tsdbCommitAddBlock(SCommitH *pCommith, const SBlock *pSupBlock, const SBlock *pSubBlocks, int nSubBlocks) {
|
||||
if (taosArrayPush(pCommith->aSupBlk, pSupBlock) < 0) {
|
||||
if (taosArrayPush(pCommith->aSupBlk, pSupBlock) == NULL) {
|
||||
terrno = TSDB_CODE_TDB_OUT_OF_MEMORY;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pSubBlocks && taosArrayPushBatch(pCommith->aSubBlk, pSubBlocks, nSubBlocks) < 0) {
|
||||
if (pSubBlocks && taosArrayPushBatch(pCommith->aSubBlk, pSubBlocks, nSubBlocks) == NULL) {
|
||||
terrno = TSDB_CODE_TDB_OUT_OF_MEMORY;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -1045,7 +1045,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
|
|||
|
||||
int code = regexec(®ex, bname, 0, NULL, 0);
|
||||
if (code == 0) {
|
||||
if (taosArrayPush(fArray, (void *)pf) < 0) {
|
||||
if (taosArrayPush(fArray, (void *)pf) == NULL) {
|
||||
terrno = TSDB_CODE_TDB_OUT_OF_MEMORY;
|
||||
tfsClosedir(tdir);
|
||||
taosArrayDestroy(fArray);
|
||||
|
|
|
@ -139,7 +139,7 @@ int tsdbLoadBlockIdx(SReadH *pReadh) {
|
|||
ptr = tsdbDecodeSBlockIdx(ptr, &blkIdx);
|
||||
ASSERT(ptr != NULL);
|
||||
|
||||
if (taosArrayPush(pReadh->aBlkIdx, (void *)(&blkIdx)) < 0) {
|
||||
if (taosArrayPush(pReadh->aBlkIdx, (void *)(&blkIdx)) == NULL) {
|
||||
terrno = TSDB_CODE_TDB_OUT_OF_MEMORY;
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue