From e62fd6cd87df48f2f163fe766f88da345e61a4e7 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 27 Oct 2024 15:38:21 -0400 Subject: [PATCH] Fix Resource Leak --- raster/r.in.poly/poly2rast.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/raster/r.in.poly/poly2rast.c b/raster/r.in.poly/poly2rast.c index e81d6f421a3..bb707d03e25 100644 --- a/raster/r.in.poly/poly2rast.c +++ b/raster/r.in.poly/poly2rast.c @@ -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; } @@ -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; }