Skip to content

Commit

Permalink
PGeo: fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Oct 30, 2024
1 parent c9a0b03 commit 348a26a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ogr/ogrsf_frmts/pgeo/ogrpgeodatasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,14 @@ int OGRPGeoDataSource::Open(GDALOpenInfo *poOpenInfo)
/* -------------------------------------------------------------------- */
if (STARTS_WITH_CI(pszNewName, "PGEO:"))
{
char *pszDSN = CPLStrdup(pszNewName + 5);
CPLDebug("PGeo", "EstablishSession(%s)", pszDSN);
const std::string osDSN = pszNewName + 5;
CPLDebug("PGeo", "EstablishSession(%s)", osDSN.c_str());
if (!oSession.EstablishSession(pszDSN, nullptr, nullptr))
{
CPLError(CE_Failure, CPLE_AppDefined,
"Unable to initialize ODBC connection to DSN for %s,\n"
"%s",
pszDSN, oSession.GetLastError());
CPLFree(pszDSN);
osDSN.c_str(), oSession.GetLastError());
return FALSE;
}
}
Expand Down

0 comments on commit 348a26a

Please sign in to comment.