[igt-dev] [PATCH i-g-t v3 2/2] tests/kms_concurrent: Plug possible memory leaks

Mika Kahola mika.kahola at intel.com
Thu Mar 26 13:53:22 UTC 2020


Free dynamically allocated memory that has a potential
to leak memory.

Signed-off-by: Mika Kahola <mika.kahola at intel.com>
---
 tests/kms_concurrent.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
index 1a7c12fc..1403e990 100644
--- a/tests/kms_concurrent.c
+++ b/tests/kms_concurrent.c
@@ -193,6 +193,10 @@ prepare_planes(data_t *data, enum pipe pipe, int max_planes,
 				    max_planes, output);
 
 	igt_plane_set_fb(data->plane[primary->index], &data->fb[primary->index]);
+
+	free(x);
+	free(y);
+	free(size);
 }
 
 static int test_bandwidth(data_t *data, enum pipe pipe, igt_output_t *output)
@@ -228,6 +232,10 @@ test_plane_position_with_output(data_t *data, enum pipe pipe, int max_planes,
 	while (i < iterations || loop_forever) {
 		prepare_planes(data, pipe, max_planes, output);
 		igt_display_commit2(&data->display, COMMIT_ATOMIC);
+
+		for (int c = 0; c < max_planes; c++)
+			igt_remove_fb(data->drm_fd, &data->fb[c]);
+
 		i++;
 	}
 }
-- 
2.20.1



More information about the igt-dev mailing list