diff --git a/src/analysis/raster/qgsrelief.cpp b/src/analysis/raster/qgsrelief.cpp index bb5f77e743e..513d8bbd6be 100644 --- a/src/analysis/raster/qgsrelief.cpp +++ b/src/analysis/raster/qgsrelief.cpp @@ -452,6 +452,9 @@ gdal::dataset_unique_ptr QgsRelief::openOutputFile( GDALDatasetH inputDataset, G //create three band raster (red, green, blue) gdal::dataset_unique_ptr outputDataset( GDALCreate( outputDriver, mOutputFile.toUtf8().constData(), xSize, ySize, 3, GDT_Byte, papszOptions ) ); + CSLDestroy( papszOptions ); + papszOptions = nullptr; + if ( !outputDataset ) { return nullptr;