Skip to content
Permalink
Browse files

GNMGenericNetwork::CopyLayer(): fix memory leak related to previous c…

…ommit
  • Loading branch information
rouault committed Feb 11, 2020
1 parent 6bb8ced commit c1364256d3d47612ca0435e24dc6d67090d9c26c
Showing with 3 additions and 11 deletions.
  1. +3 −11 gdal/gnm/gnmgenericnetwork.cpp
@@ -1388,17 +1388,9 @@ int GNMGenericNetwork::TestCapability( const char * pszCap )
OGRLayer *GNMGenericNetwork::CopyLayer(OGRLayer *poSrcLayer,
const char *pszNewName, char **papszOptions)
{
if(CSLFindName(papszOptions, "DST_SRSWKT") == -1)
{
papszOptions = CSLAddNameValue(papszOptions, "DST_SRSWKT",
GetProjectionRef());
}
else
{
papszOptions = CSLSetNameValue(papszOptions, "DST_SRSWKT",
GetProjectionRef());
}
return GDALDataset::CopyLayer(poSrcLayer, pszNewName, papszOptions);
CPLStringList aosOptions(CSLDuplicate(papszOptions));
aosOptions.SetNameValue("DST_SRSWKT", GetProjectionRef());
return GDALDataset::CopyLayer(poSrcLayer, pszNewName, aosOptions.List());
}

int GNMGenericNetwork::CloseDependentDatasets()

0 comments on commit c136425

Please sign in to comment.
You can’t perform that action at this time.