Merge pull request #3026 from taosdata/feature/2.0tsdb

fix .h file coredump
This commit is contained in:
Xiaxin Li 2020-08-12 13:04:31 +08:00 committed by GitHub
commit 7da7b6177c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -128,7 +128,11 @@ int tsdbOpenFileH(STsdbRepo *pRepo) {
code = regexec(&regex2, dp->d_name, 0, NULL, 0);
if (code == 0) {
tsdbDebug("vgId:%d invalid file %s exists, remove it", REPO_ID(pRepo), dp->d_name);
remove(dp->d_name);
char *fname = malloc(strlen(tDataDir) + strlen(dp->d_name) + 2);
if (fname == NULL) goto _err;
sprintf(fname, "%s/%s", tDataDir, dp->d_name);
remove(fname);
free(fname);
} else if (code == REG_NOMATCH) {
tsdbError("vgId:%d invalid file %s exists, ignore it", REPO_ID(pRepo), dp->d_name);
continue;