فهرست منبع

r.sim: fix r.sim.sediment segfault, memory freeing was in wrong place (#1094)

Anna Petrasova 4 سال پیش
والد
کامیت
12e17c123a
3فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 1 0
      raster/r.sim/r.sim.sediment/main.c
  2. 1 0
      raster/r.sim/r.sim.water/main.c
  3. 0 1
      raster/r.sim/simlib/output.c

+ 1 - 0
raster/r.sim/r.sim.sediment/main.c

@@ -434,6 +434,7 @@ int main(int argc, char *argv[])
 	if (ii != 1)
 	if (ii != 1)
 	    G_fatal_error(_("Cannot write raster maps"));
 	    G_fatal_error(_("Cannot write raster maps"));
     }
     }
+    free_walkers();
 
 
     /* Exit with Success */
     /* Exit with Success */
     exit(EXIT_SUCCESS);
     exit(EXIT_SUCCESS);

+ 1 - 0
raster/r.sim/r.sim.water/main.c

@@ -533,6 +533,7 @@ int main(int argc, char *argv[])
 
 
     grad_check();
     grad_check();
     main_loop();
     main_loop();
+    free_walkers();
 
 
     /* Exit with Success */
     /* Exit with Success */
     exit(EXIT_SUCCESS);
     exit(EXIT_SUCCESS);

+ 0 - 1
raster/r.sim/simlib/output.c

@@ -767,7 +767,6 @@ int output_et()
 	Rast_free_colors(&colors);
 	Rast_free_colors(&colors);
 	/*  } */
 	/*  } */
     }
     }
-    free_walkers();
 
 
     return 1;
     return 1;
 }
 }