From df288e779e5e64b05d56878f4109a8bde03f1084 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Sun, 16 Aug 2020 15:35:51 +0800 Subject: [PATCH] fix sync memory leak --- src/tsdb/src/tsdbMain.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tsdb/src/tsdbMain.c b/src/tsdb/src/tsdbMain.c index 733bca6af5..e2d7d03eda 100644 --- a/src/tsdb/src/tsdbMain.c +++ b/src/tsdb/src/tsdbMain.c @@ -249,7 +249,11 @@ uint32_t tsdbGetFileInfo(TSDB_REPO_T *repo, char *name, uint32_t *index, uint32_ } else { // get the named file at the specified index. If not there, return 0 fname = malloc(prefixLen + strlen(name) + 2); sprintf(fname, "%s/%s", prefix, name); - if (access(fname, F_OK) != 0) return 0; + if (access(fname, F_OK) != 0) { + taosFree(fname); + taosFree(sdup) + return 0; + } if (*index == TSDB_META_FILE_INDEX) { // get meta file tsdbGetStoreInfo(fname, &magic, size); } else { -- GitLab