From 2727293d83fbe9403b68848b5cd7e87cc056f767 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Tue, 17 Dec 2024 20:58:40 -0500 Subject: [PATCH] Fix Resource Leak issue --- lib/rst/interp_float/segmen2d.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/rst/interp_float/segmen2d.c b/lib/rst/interp_float/segmen2d.c index f2b13951691..d6486d3fcc2 100644 --- a/lib/rst/interp_float/segmen2d.c +++ b/lib/rst/interp_float/segmen2d.c @@ -283,8 +283,10 @@ int IL_interp_segments_2d( } else if (segtest == 1) { if (params->matrix_create(params, data->points, - data->n_points - 1, matrix, indx) < 0) + data->n_points - 1, matrix, indx) < 0) { + G_free(point); return -1; + } } if (!params->cv) { for (i = 0; i < data->n_points; i++) @@ -332,6 +334,7 @@ int IL_interp_segments_2d( G_free(data->points); G_free(data); } + G_free(point); return 1; }