Ticket #4709 (closed defect: fixed)
NCDFAddGDALHistory() uses free'd memory
| Reported by: | rouault | Owned by: | rouault |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.9.2 |
| Component: | GDAL_Raster | Version: | 1.9.0 |
| Severity: | normal | Keywords: | netcdf |
| Cc: | etourigny |
Description
Detected by valgrind :
nc_put_att_text( fpImage, NC_GLOBAL, "GDAL", strlen(NCDF_GDAL), NCDF_GDAL ); uses free'd memory since successive calls to GDALVersionInfo() will free the buffer returned by the previous call.
Solution : store NCDF_GDAL in a local variable to avoid calling GDALVersionInfo() twice.
Change History
Note: See
TracTickets for help on using
tickets.
