fix sync memory leak

This commit is contained in:
Hongze Cheng 2020-08-16 15:35:51 +08:00
parent b0c9fc3201
commit df288e779e
1 changed files with 5 additions and 1 deletions

View File

@ -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 {