Skip to content

Commit

Permalink
GDALOpen(): fix memleaks (master only)
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Nov 28, 2023
1 parent 62580ed commit ae35a89
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gcore/gdaldataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3636,6 +3636,9 @@ GDALDatasetH CPL_STDCALL GDALOpenEx(const char *pszFilename,
: GDAL_IDENTIFY_UNKNOWN;
if (nIdentifyRes == FALSE)
{
CSLDestroy(papszTmpOpenOptions);
CSLDestroy(papszTmpOpenOptionsToValidate);
oOpenInfo.papszOpenOptions = papszOpenOptionsCleaned;
continue;
}
else if (iPass == 1 && nIdentifyRes < 0 &&
Expand All @@ -3644,6 +3647,9 @@ GDALDatasetH CPL_STDCALL GDALOpenEx(const char *pszFilename,
{
// Not loaded plugin
apoSecondPassDrivers.push_back(poDriver);
CSLDestroy(papszTmpOpenOptions);
CSLDestroy(papszTmpOpenOptionsToValidate);
oOpenInfo.papszOpenOptions = papszOpenOptionsCleaned;
continue;
}

Expand Down

0 comments on commit ae35a89

Please sign in to comment.