瀏覽代碼

free memory (fix trac https://trac.osgeo.org/grass/ticket/1030)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41902 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 15 年之前
父節點
當前提交
785cc353ee

+ 2 - 0
raster/r.li/r.li.cwed/cwed.c

@@ -432,6 +432,8 @@ int calculate(int fd, area_des ad, Coppie * cc, long totCoppie,
 	G_free(mask_corr);
 	G_free(mask_sup);
     }
+    
+    G_free(buf_sup);
     return RLI_OK;
 }
 

+ 2 - 0
raster/r.li/r.li.edgedensity/edgedensity.c

@@ -376,6 +376,8 @@ int calculate(int fd, area_des ad, char **valore, double *result)
 	G_free(mask_inf);
 	G_free(mask_corr);
     }
+    
+    G_free(buf_sup);
     return RLI_OK;
 }
 

+ 1 - 0
raster/r.li/r.li.mps/mps.c

@@ -473,6 +473,7 @@ int calculate(int fd, area_des ad, struct Cell_head hd, double *result)
 
     G_free(mask_patch_corr);
 
+    G_free(buf_sup);
     return RLI_OK;
 }
 

+ 2 - 0
raster/r.li/r.li.padcv/padcv.c

@@ -520,6 +520,8 @@ int calculate(int fd, area_des ad, double *result)
 	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)

+ 2 - 0
raster/r.li/r.li.padrange/padrange.c

@@ -508,6 +508,8 @@ int calculate(int fd, area_des ad, double *result)
     G_free(mask_patch_sup);
 
     *result = indice;
+
+    G_free(buf_sup);
     return RLI_OK;
 }
 

+ 3 - 0
raster/r.li/r.li.padsd/padsd.c

@@ -517,6 +517,9 @@ int calculate(int fd, area_des ad, double *result)
 	G_free(mask_buf);
     G_free(mask_patch_sup);
     *result = indice;
+
+    G_free(buf_sup);
+    G_free(buf);
     return RLI_OK;
 }
 

+ 4 - 1
raster/r.li/r.li.patchdensity/main.c

@@ -21,6 +21,7 @@
 #include <grass/raster.h>
 #include <grass/glocale.h>
 #include "../r.li.daemon/daemon.h"
+#include "../r.li.daemon/defs.h"
 
 int main(int argc, char *argv[])
 {
@@ -199,5 +200,7 @@ int patch_density(int fd, char **par, area_des ad, double *result)
 	*result = (count / area) * 1000000;
     else
 	*result = -1;
-    return 1;
+
+    G_free(sup);
+    return RLI_OK;
 }

+ 4 - 3
raster/r.li/r.li.patchnum/main.c

@@ -22,6 +22,7 @@
 #include <grass/raster.h>
 #include <grass/glocale.h>
 #include "../r.li.daemon/daemon.h"
+#include "../r.li.daemon/defs.h"
 
 int main(int argc, char *argv[])
 {
@@ -174,8 +175,8 @@ int patch_number(int fd, char **par, area_des ad, double *result)
 
     }
 
-
-
     *result = count;
-    return 1;
+
+    G_free(sup);
+    return RLI_OK;
 }