[GRASS-SVN] r41901 - in grass/branches/develbranch_6/raster/r.li: r.li.cwed r.li.edgedensity r.li.mps r.li.padcv r.li.padrange r.li.padsd r.li.patchdensity r.li.patchnum

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 17 04:13:04 EDT 2010


Author: neteler
Date: 2010-04-17 04:13:04 -0400 (Sat, 17 Apr 2010)
New Revision: 41901

Modified:
   grass/branches/develbranch_6/raster/r.li/r.li.cwed/cwed.c
   grass/branches/develbranch_6/raster/r.li/r.li.edgedensity/edgedensity.c
   grass/branches/develbranch_6/raster/r.li/r.li.mps/mps.c
   grass/branches/develbranch_6/raster/r.li/r.li.padcv/padcv.c
   grass/branches/develbranch_6/raster/r.li/r.li.padrange/padrange.c
   grass/branches/develbranch_6/raster/r.li/r.li.padsd/padsd.c
   grass/branches/develbranch_6/raster/r.li/r.li.patchdensity/main.c
   grass/branches/develbranch_6/raster/r.li/r.li.patchnum/main.c
Log:
free memory (fix trac #1030)

Modified: grass/branches/develbranch_6/raster/r.li/r.li.cwed/cwed.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.cwed/cwed.c	2010-04-17 08:12:48 UTC (rev 41900)
+++ grass/branches/develbranch_6/raster/r.li/r.li.cwed/cwed.c	2010-04-17 08:13:04 UTC (rev 41901)
@@ -436,6 +436,8 @@
 	G_free(mask_corr);
 	G_free(mask_sup);
     }
+    
+    G_free(buf_sup);
     return RLI_OK;
 }
 

Modified: grass/branches/develbranch_6/raster/r.li/r.li.edgedensity/edgedensity.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.edgedensity/edgedensity.c	2010-04-17 08:12:48 UTC (rev 41900)
+++ grass/branches/develbranch_6/raster/r.li/r.li.edgedensity/edgedensity.c	2010-04-17 08:13:04 UTC (rev 41901)
@@ -381,6 +381,8 @@
 	G_free(mask_inf);
 	G_free(mask_corr);
     }
+    
+    G_free(buf_sup);
     return RLI_OK;
 }
 

Modified: grass/branches/develbranch_6/raster/r.li/r.li.mps/mps.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.mps/mps.c	2010-04-17 08:12:48 UTC (rev 41900)
+++ grass/branches/develbranch_6/raster/r.li/r.li.mps/mps.c	2010-04-17 08:13:04 UTC (rev 41901)
@@ -480,6 +480,7 @@
 
     G_free(mask_patch_corr);
 
+    G_free(buf_sup);
     return RLI_OK;
 }
 

Modified: grass/branches/develbranch_6/raster/r.li/r.li.padcv/padcv.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.padcv/padcv.c	2010-04-17 08:12:48 UTC (rev 41900)
+++ grass/branches/develbranch_6/raster/r.li/r.li.padcv/padcv.c	2010-04-17 08:13:04 UTC (rev 41901)
@@ -487,6 +487,8 @@
 	G_free(mask_buf);
     G_free(mask_patch_sup);
     *result = indice;
+
+    G_free(buf_sup);
     return RLI_OK;
 }
 int calculateD(int fd, area_des ad, double *result)

Modified: grass/branches/develbranch_6/raster/r.li/r.li.padrange/padrange.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.padrange/padrange.c	2010-04-17 08:12:48 UTC (rev 41900)
+++ grass/branches/develbranch_6/raster/r.li/r.li.padrange/padrange.c	2010-04-17 08:13:04 UTC (rev 41901)
@@ -501,6 +501,8 @@
     G_free(mask_patch_sup);
 
     *result = indice;
+
+    G_free(buf_sup);
     return RLI_OK;
 }
 

Modified: grass/branches/develbranch_6/raster/r.li/r.li.padsd/padsd.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.padsd/padsd.c	2010-04-17 08:12:48 UTC (rev 41900)
+++ grass/branches/develbranch_6/raster/r.li/r.li.padsd/padsd.c	2010-04-17 08:13:04 UTC (rev 41901)
@@ -485,6 +485,9 @@
 	G_free(mask_buf);
     G_free(mask_patch_sup);
     *result = indice;
+
+    G_free(buf_sup);
+    G_free(buf);
     return RLI_OK;
 }
 

Modified: grass/branches/develbranch_6/raster/r.li/r.li.patchdensity/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.patchdensity/main.c	2010-04-17 08:12:48 UTC (rev 41900)
+++ grass/branches/develbranch_6/raster/r.li/r.li.patchdensity/main.c	2010-04-17 08:13:04 UTC (rev 41901)
@@ -20,6 +20,7 @@
 #include <grass/gis.h>
 #include <grass/glocale.h>
 #include "../r.li.daemon/daemon.h"
+#include "../r.li.daemon/defs.h"
 
 int main(int argc, char *argv[])
 {
@@ -198,5 +199,7 @@
 	*result = (count / area) * 1000000;
     else
 	*result = -1;
-    return 1;
+
+    G_free(sup);
+    return RLI_OK;
 }

Modified: grass/branches/develbranch_6/raster/r.li/r.li.patchnum/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.patchnum/main.c	2010-04-17 08:12:48 UTC (rev 41900)
+++ grass/branches/develbranch_6/raster/r.li/r.li.patchnum/main.c	2010-04-17 08:13:04 UTC (rev 41901)
@@ -21,6 +21,7 @@
 #include <grass/gis.h>
 #include <grass/glocale.h>
 #include "../r.li.daemon/daemon.h"
+#include "../r.li.daemon/defs.h"
 
 int main(int argc, char *argv[])
 {
@@ -173,8 +174,8 @@
 
     }
 
+    *result = count;
 
-
-    *result = count;
-    return 1;
+    G_free(sup);
+    return RLI_OK;
 }



More information about the grass-commit mailing list