Skip to content

Commit 3c18f7e

Browse files
authored
Fix use-after-free error in msDrawRasterLayerLowOpenDataset (MapServer#7333)
* Fix use-after-free error in msDrawRasterLayerLowOpenDataset * A test case for crash on printing raster debug info
1 parent 4c675f5 commit 3c18f7e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

msautotest/wxs/wms_raster.map

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ IMAGECOLOR 255 255 255
3131
SHAPEPATH ./data
3232
SYMBOLSET etc/symbols.sym
3333
FONTSET etc/fonts.txt
34-
34+
DEBUG 1
3535

3636
#
3737
# Start of web interface definition

src/mapraster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,6 @@ void *msDrawRasterLayerLowOpenDataset(mapObj *map, layerObj *layer,
651651
GDALOpenEx(*p_decrypted_path, GDAL_OF_RASTER | GDAL_OF_SHARED,
652652
(const char *const *)papszAllowedDrivers,
653653
(const char *const *)connectionoptions, NULL);
654-
CSLDestroy(papszAllowedDrivers);
655654
CSLDestroy(connectionoptions);
656655

657656
// Give a hint about which GDAL driver should be enabled, but only in
@@ -678,6 +677,7 @@ void *msDrawRasterLayerLowOpenDataset(mapObj *map, layerObj *layer,
678677
}
679678
}
680679
}
680+
CSLDestroy(papszAllowedDrivers);
681681
return hDS;
682682
} else {
683683
return GDALOpenShared(*p_decrypted_path, GA_ReadOnly);

0 commit comments

Comments
 (0)