Skip to content

Commit

Permalink
mode of alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Jun 10, 2024
1 parent 1a474de commit 3d082ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions inst/include/gdalwarpgeneral/gdalwarpgeneral.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ inline List gdal_warp_general(CharacterVector dsn,
LogicalVector nara) {


GDALDatasetH *poSrcDS;
poSrcDS = static_cast<GDALDatasetH *>(CPLMalloc(sizeof(GDALDatasetH) * static_cast<size_t>(dsn.size())));
GDALDatasetH *poSrcDS = nullptr;;

IntegerVector sds0 = IntegerVector::create(0);
for (int i = 0; i < dsn.size(); i++) {
poSrcDS = static_cast<GDALDatasetH *>(CPLRealloc(poSrcDS, sizeof(GDALDatasetH) * static_cast<size_t>(dsn.size())));

poSrcDS[i] = gdalraster::gdalH_open_dsn(dsn[i], sds0);
// unwind everything, and stop (why not unwind if all are null, message how many succeed)
if (poSrcDS[i] == nullptr) {
Expand Down

0 comments on commit 3d082ac

Please sign in to comment.