From 46b13b8ad1aac20f3555e27adc97e931a7888e44 Mon Sep 17 00:00:00 2001 From: hzcheng Date: Tue, 21 Apr 2020 13:42:36 +0800 Subject: [PATCH] Fix valgrind warning --- src/tsdb/src/tsdbMain.c | 3 ++- src/tsdb/src/tsdbRWHelper.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tsdb/src/tsdbMain.c b/src/tsdb/src/tsdbMain.c index 648188cdae..925ff32cb5 100644 --- a/src/tsdb/src/tsdbMain.c +++ b/src/tsdb/src/tsdbMain.c @@ -387,7 +387,7 @@ int tsdbInitTableCfg(STableCfg *config, ETableType type, int64_t uid, int32_t ti config->superUid = TSDB_INVALID_SUPER_TABLE_ID; config->tableId.uid = uid; config->tableId.tid = tid; - config->name = strdup("test1"); + config->name = NULL; return 0; } @@ -880,6 +880,7 @@ static void *tsdbCommitData(void *arg) { _exit: tdFreeDataCols(pDataCols); tsdbDestroyTableIters(iters, pCfg->maxTables); + tsdbDestroyHelper(&whelper); tsdbLockRepo(arg); tdListMove(pCache->imem->list, pCache->pool.memPool); diff --git a/src/tsdb/src/tsdbRWHelper.c b/src/tsdb/src/tsdbRWHelper.c index c0f509d1f2..8b5364e362 100644 --- a/src/tsdb/src/tsdbRWHelper.c +++ b/src/tsdb/src/tsdbRWHelper.c @@ -403,6 +403,7 @@ int tsdbWriteCompInfo(SRWHelper *pHelper) { } else { pHelper->pCompInfo->delimiter = TSDB_FILE_DELIMITER; pHelper->pCompInfo->uid = pHelper->tableInfo.uid; + pHelper->pCompInfo->checksum = 0; ASSERT((pIdx->len - sizeof(SCompInfo) - sizeof(TSCKSUM)) % sizeof(SCompBlock) == 0); taosCalcChecksumAppend(0, (uint8_t *)pHelper->pCompInfo, pIdx->len); pIdx->offset = lseek(pHelper->files.nHeadF.fd, 0, SEEK_END); -- GitLab