Skip to content
Snippets Groups Projects
Commit 65467c1c authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Fixing output string when no output projection is found

parent 69b4079a
Branches
Tags
No related merge requests found
......@@ -232,7 +232,8 @@ OGRSpatialReference const* otb::ogr::Layer::GetSpatialRef() const
std::string otb::ogr::Layer::GetProjectionRef() const
{
char * wkt;
std::string stringWkt = "";
assert(m_Layer && "OGRLayer not initialized");
OGRSpatialReference * srs = m_Layer->GetSpatialRef();
......@@ -246,14 +247,10 @@ std::string otb::ogr::Layer::GetProjectionRef() const
itkGenericExceptionMacro(<< "Cannot convert spatial reference to wkt string for layer <"
<<m_Layer->GetName()<<">: " << CPLGetLastErrorMsg());
}
}
std::string stringWkt(wkt);
stringWkt = wkt;
// According to documentation, argument of exportToWkt() should be
// freed
if(srs)
{
// According to documentation, argument of exportToWkt() should be
// freed
CPLFree(wkt);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment