diff --git a/source/libs/wal/src/walMgmt.c b/source/libs/wal/src/walMgmt.c index edf702b948..e2c5e66158 100644 --- a/source/libs/wal/src/walMgmt.c +++ b/source/libs/wal/src/walMgmt.c @@ -123,11 +123,9 @@ int32_t walInitWriteFileForSkip(SWal *pWal) { pWal->writeCur = 0; _exit: if (code != TSDB_CODE_SUCCESS) { - if (pIdxTFile) (void)taosCloseFile(&pIdxTFile); - if (pLogTFile) (void)taosCloseFile(&pLogTFile); + (void)taosCloseFile(&pIdxTFile); + (void)taosCloseFile(&pLogTFile); } - (void)taosCloseFile(&pIdxTFile); - (void)taosCloseFile(&pLogTFile); TAOS_RETURN(code); }