#4709 closed defect (fixed)
NCDFAddGDALHistory() uses free'd memory
Reported by: | Even Rouault | Owned by: | Even 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.
Note:
See TracTickets
for help on using tickets.
r24588 /trunk/gdal/frmts/netcdf/ (netcdfdataset.cpp netcdfdataset.h): netCDF: fix use of free'd memory in NCDFAddGDALHistory() (#4709)
r24589 /branches/1.9/gdal/frmts/netcdf/ (netcdfdataset.cpp netcdfdataset.h): netCDF: fix use of free'd memory in NCDFAddGDALHistory() (#4709)