From d8e7ae442aa749ed2179e8b724102bb367c7324d Mon Sep 17 00:00:00 2001 From: duzhuolin Date: Tue, 8 Aug 2023 14:49:04 +0800 Subject: [PATCH] =?UTF-8?q?pageHack=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contrib/pagehack/pagehack.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/pagehack/pagehack.cpp b/contrib/pagehack/pagehack.cpp index eab5c5186..8adaed889 100644 --- a/contrib/pagehack/pagehack.cpp +++ b/contrib/pagehack/pagehack.cpp @@ -3230,6 +3230,7 @@ static int parse_uncompressed_page_file(const char *filename, SegmentType type, /* parse */ number = CalculateMaxBlockNumber(blknum, start, number); if (number == InvalidBlockNumber) { + fclose(fd); return false; } else if ((start + number) > blknum) { fprintf(stderr, @@ -4492,6 +4493,8 @@ static bool parse_dw_file(const char* file_name, uint32 start_page, uint32 page_ if (start_page >= dw_batch_page_num) { fprintf(stdout, "start_page %u exceeds the double write file upper limit offset %u\n", start_page, dw_batch_page_num - 1); + free(dw_buf); + fclose(fd); return false; } file_head.start = (uint16)start_page;