[GRASS-SVN] r74334 - grass/trunk/misc/m.nviz.script
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Apr 2 01:56:48 PDT 2019
Author: mmetz
Date: 2019-04-02 01:56:48 -0700 (Tue, 02 Apr 2019)
New Revision: 74334
Modified:
grass/trunk/misc/m.nviz.script/main.c
Log:
m.nviz.script: fix memory leaks
Modified: grass/trunk/misc/m.nviz.script/main.c
===================================================================
--- grass/trunk/misc/m.nviz.script/main.c 2019-04-01 20:29:07 UTC (rev 74333)
+++ grass/trunk/misc/m.nviz.script/main.c 2019-04-02 08:56:48 UTC (rev 74334)
@@ -450,11 +450,11 @@
if (data_type == CELL_TYPE) {
cell = Rast_allocate_c_buf();
Rast_get_c_row(fd, cell, row);
-
if (Rast_is_c_null_value(&cell[col]))
camera_height = (double)9999.;
else
camera_height = (double)cell[col];
+ G_free(cell);
}
if (data_type == FCELL_TYPE) {
@@ -464,6 +464,7 @@
camera_height = (double)9999.;
else
camera_height = (double)fcell[col];
+ G_free(fcell);
}
if (data_type == DCELL_TYPE) {
@@ -473,6 +474,7 @@
camera_height = (double)9999.;
else
camera_height = (double)dcell[col];
+ G_free(dcell);
}
/* Output script commands */
More information about the grass-commit
mailing list