From badc1cd714522420234f3d9dc0ead4b1bb5f3411 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 5 Jan 2025 20:41:10 +0100 Subject: [PATCH] GDALDataset::BuildOverviews(): fix memleak in error code path (master only) --- gcore/gdaldataset.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gcore/gdaldataset.cpp b/gcore/gdaldataset.cpp index ca17538cead6..a6bf53191298 100644 --- a/gcore/gdaldataset.cpp +++ b/gcore/gdaldataset.cpp @@ -2160,6 +2160,7 @@ CPLErr GDALDataset::BuildOverviews(const char *pszResampling, int nOverviews, "panOverviewList[%d] = %d is invalid. It must be a " "positive value", i, panOverviewList[i]); + CPLFree(panAllBandList); return CE_Failure; } }