From dc62692049ba94b90a7f7bc177b2ce5d09277dbe Mon Sep 17 00:00:00 2001 From: he-shaoyu Date: Mon, 25 Sep 2023 09:37:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DrepallocFileInfo=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F=E9=A3=8E=E9=99=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bin/gsqlerr/scanEreport.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bin/gsqlerr/scanEreport.cpp b/src/bin/gsqlerr/scanEreport.cpp index 3946e64ad..20b6cf6db 100644 --- a/src/bin/gsqlerr/scanEreport.cpp +++ b/src/bin/gsqlerr/scanEreport.cpp @@ -595,10 +595,12 @@ typedef struct { static FileInfo *repallocFileInfo(FileInfo *file_infos, const int new_num, const int old_num) { if (new_num < 0 || (size_t)new_num >= ((0x3fffffff) / sizeof(FileInfo *))) { + free(file_infos); return NULL; } FileInfo *tmps = (FileInfo *)malloc(sizeof(FileInfo) * new_num); if (tmps == NULL) { + free(file_infos); return NULL; } for (int i = 0; i < old_num; i++) {