I get a crash when calling the CopyLayer function. Pseudo code: char** options = CSLAddString(nullptr, "DST_SRSWKT=some_wkt"); ds->CopyLayer(srcLayer, "newname", options); CSLDestroy(options);
Inside GDALDataset::CopyLayer the DST_SRSWKT option is removed from the list: // Remove DST_WKT from option list to prevent warning from driver. const int nSRSPos = CSLFindName(papszOptions, "DST_SRSWKT"); papszOptions = CSLRemoveStrings(papszOptions, nSRSPos, 1, nullptr); But since this is the only option CSLDestroy is called on the options pointer. So the CSLDestroy(options) after the copy causes a crash since the memory is deleted twice. How is this supported to be handled? How can the caller know the options array has been destroyed by the CopyLayer function? Kind regards, Dirk
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
