Skip to content

Commit

Permalink
r.in.poly: Fix Resource Leak issue in poly2rast.c (OSGeo#4605)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShubhamDesai authored Oct 27, 2024
1 parent ffcb9e1 commit 84afcf4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions raster/r.in.poly/poly2rast.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ int poly_to_rast(char *input_file, char *raster_map, char *title, int nrows,

if (stat < 0) {
Rast_unopen(rfd);
fclose(ifd);
return 1;
}

Expand All @@ -98,6 +99,7 @@ int poly_to_rast(char *input_file, char *raster_map, char *title, int nrows,
Rast_short_history(raster_map, "raster", &history);
Rast_command_history(&history);
Rast_write_history(raster_map, &history);
fclose(ifd);

return 0;
}

0 comments on commit 84afcf4

Please sign in to comment.