[GRASS-SVN] r69753 - grass/branches/releasebranch_7_2/lib/raster
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Oct 28 15:00:40 PDT 2016
Author: mmetz
Date: 2016-10-28 15:00:39 -0700 (Fri, 28 Oct 2016)
New Revision: 69753
Modified:
grass/branches/releasebranch_7_2/lib/raster/close.c
grass/branches/releasebranch_7_2/lib/raster/open.c
Log:
rasterlib: fix memory leak for compressed null files (backport from trunk r69751)
Modified: grass/branches/releasebranch_7_2/lib/raster/close.c
===================================================================
--- grass/branches/releasebranch_7_2/lib/raster/close.c 2016-10-28 21:25:12 UTC (rev 69752)
+++ grass/branches/releasebranch_7_2/lib/raster/close.c 2016-10-28 22:00:39 UTC (rev 69753)
@@ -155,6 +155,8 @@
if (fcb->null_bits)
G_free(fcb->null_bits);
+ if (fcb->null_row_ptr)
+ G_free(fcb->null_row_ptr);
if (fcb->null_fd >= 0)
close(fcb->null_fd);
fcb->null_fd = -1;
@@ -478,6 +480,9 @@
G_free(fcb->null_bits);
+ if (fcb->null_row_ptr)
+ G_free(fcb->null_row_ptr);
+
if (fcb->map_type != CELL_TYPE)
Rast_quant_free(&fcb->quant);
Modified: grass/branches/releasebranch_7_2/lib/raster/open.c
===================================================================
--- grass/branches/releasebranch_7_2/lib/raster/open.c 2016-10-28 21:25:12 UTC (rev 69752)
+++ grass/branches/releasebranch_7_2/lib/raster/open.c 2016-10-28 22:00:39 UTC (rev 69753)
@@ -708,6 +708,7 @@
fcb->null_temp_name = tempname;
+ fcb->null_row_ptr = NULL;
if (R__.compress_nulls) {
fcb->null_row_ptr = G_calloc(fcb->cellhd.rows + 1, sizeof(off_t));
G_zero(fcb->row_ptr, (fcb->cellhd.rows + 1) * sizeof(off_t));
More information about the grass-commit
mailing list