diff --git a/src/tsdb/src/tsdbCommit.c b/src/tsdb/src/tsdbCommit.c index 8327f259f71e62c188183d2413d75a18451e2a72..d432c951dd1d91e12c7338aeda9b0619bd949b6d 100644 --- a/src/tsdb/src/tsdbCommit.c +++ b/src/tsdb/src/tsdbCommit.c @@ -128,7 +128,7 @@ _err: int tsdbApplyRtnOnFSet(STsdbRepo *pRepo, SDFileSet *pSet, SRtn *pRtn) { SDiskID did; - SDFileSet nSet; + SDFileSet nSet = {0}; STsdbFS * pfs = REPO_FS(pRepo); int level; diff --git a/src/tsdb/src/tsdbFS.c b/src/tsdb/src/tsdbFS.c index 1ef516b305ea5c41371d735f8f9d06a232e5f982..b3d52e8fad1c81c55003470d024fd48278384f8c 100644 --- a/src/tsdb/src/tsdbFS.c +++ b/src/tsdb/src/tsdbFS.c @@ -91,10 +91,8 @@ static int tsdbEncodeDFileSetArray(void **buf, SArray *pArray) { } static int tsdbDecodeDFileSetArray(void **originBuf, void *buf, SArray *pArray, SFSHeader *pSFSHeader) { - uint64_t nset; - SDFileSet dset; - dset.ver = TSDB_FSET_VER_0; // default value - + uint64_t nset = 0; + taosArrayClear(pArray); buf = taosDecodeFixedU64(buf, &nset); @@ -113,6 +111,7 @@ static int tsdbDecodeDFileSetArray(void **originBuf, void *buf, SArray *pArray, } for (size_t i = 0; i < nset; i++) { + SDFileSet dset = {0}; // ver is TSDB_FSET_VER_0(0) at default buf = tsdbDecodeDFileSet(buf, &dset, pSFSHeader->version); taosArrayPush(pArray, (void *)(&dset)); } diff --git a/src/tsdb/src/tsdbSync.c b/src/tsdb/src/tsdbSync.c index 0e01cf37bb264b1d2eb36b7332e2ebea28edfce9..834ed8b5a8fdd8695e299d5e4947780dfa5dad83 100644 --- a/src/tsdb/src/tsdbSync.c +++ b/src/tsdb/src/tsdbSync.c @@ -457,7 +457,7 @@ static int32_t tsdbSyncRecvDFileSetArray(SSyncH *pSynch) { // Create local files and copy from remote SDiskID did; - SDFileSet fset; + SDFileSet fset = {0}; tfsAllocDisk(fidLevel, &(did.level), &(did.id)); if (did.level == TFS_UNDECIDED_LEVEL) {