Skip to content

Commit

Permalink
r.sim: fix r.sim.sediment segfault, memory freeing was in wrong place (
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa authored and neteler committed Nov 18, 2020
1 parent 7a71955 commit 45eabbb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions raster/r.sim/r.sim.sediment/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ int main(int argc, char *argv[])
if (ii != 1)
G_fatal_error(_("Cannot write raster maps"));
}
free_walkers();

/* Exit with Success */
exit(EXIT_SUCCESS);
Expand Down
1 change: 1 addition & 0 deletions raster/r.sim/r.sim.water/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ int main(int argc, char *argv[])

grad_check();
main_loop();
free_walkers();

/* Exit with Success */
exit(EXIT_SUCCESS);
Expand Down
1 change: 0 additions & 1 deletion raster/r.sim/simlib/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,6 @@ int output_et()
Rast_free_colors(&colors);
/* } */
}
free_walkers();

return 1;
}

0 comments on commit 45eabbb

Please sign in to comment.