fix mem leak at walFindCurMetaVer

This commit is contained in:
xiao-77 2024-09-27 14:10:05 +08:00
parent bed1a673b4
commit 6370e5b782
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);