Merge pull request #28154 from taosdata/fix/3.0/TD-32377

fix mem leak at walFindCurMetaVer
This commit is contained in:
Hongze Cheng 2024-09-27 16:40:04 +08:00 committed by GitHub
commit 8dc3a061c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -937,6 +937,7 @@ static int walFindCurMetaVer(SWal* pWal) {
TdDirPtr pDir = taosOpenDir(pWal->path);
if (pDir == NULL) {
wError("vgId:%d, path:%s, failed to open since %s", pWal->cfg.vgId, pWal->path, tstrerror(terrno));
regfree(&walMetaRegexPattern);
return terrno;
}
@ -956,6 +957,7 @@ static int walFindCurMetaVer(SWal* pWal) {
}
if (taosCloseDir(&pDir) != 0) {
wError("failed to close dir, ret:%s", tstrerror(terrno));
regfree(&walMetaRegexPattern);
return terrno;
}
regfree(&walMetaRegexPattern);