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 3761727 commit 0384335
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 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);
if (!oSession.EstablishSession(pszDSN, nullptr, nullptr))
const std::string osDSN = pszNewName + 5;
CPLDebug("PGeo", "EstablishSession(%s)", osDSN.c_str());
if (!oSession.EstablishSession(osDSN.c_str(), 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 0384335

Please sign in to comment.