Merge pull request #24800 from taosdata/szhou/fix/ts-4506

fix: free fd to reuse the space
This commit is contained in:
dapan1121 2024-02-22 16:25:41 +08:00 committed by GitHub
commit 16ca49010a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -1329,7 +1329,6 @@ int32_t taosCompressFile(char *srcFileName, char *destFileName) {
char *data = taosMemoryMalloc(compressSize); char *data = taosMemoryMalloc(compressSize);
gzFile dstFp = NULL; gzFile dstFp = NULL;
TdFilePtr pFile = NULL;
TdFilePtr pSrcFile = NULL; TdFilePtr pSrcFile = NULL;
pSrcFile = taosOpenFile(srcFileName, TD_FILE_READ | TD_FILE_STREAM); pSrcFile = taosOpenFile(srcFileName, TD_FILE_READ | TD_FILE_STREAM);
@ -1369,8 +1368,8 @@ int32_t taosCompressFile(char *srcFileName, char *destFileName) {
} }
cmp_end: cmp_end:
if (pFile) { if (fd >= 0) {
taosCloseFile(&pFile); close(fd);
} }
if (pSrcFile) { if (pSrcFile) {
taosCloseFile(&pSrcFile); taosCloseFile(&pSrcFile);