[PATCH i-g-t v2 5/7] runner: Free settings at the end

Lucas De Marchi lucas.demarchi at intel.com
Tue Jan 21 22:57:31 UTC 2025


Keep valgrind happy with the normal allocations so we can find the real
leaks. Avoid this kind of leak:

	==806592== 8 bytes in 1 blocks are definitely lost in loss record 46 of 188
	==806592==    at 0x4846828: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
	==806592==    by 0x4BD534E: strdup (strdup.c:42)
	==806592==    by 0x10E6AA: parse_options (settings.c:863)
	==806592==    by 0x10D2DD: main (runner.c:19)

Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
 runner/resume.c | 2 ++
 runner/runner.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/runner/resume.c b/runner/resume.c
index 0f4e42bfa..ed17351c6 100644
--- a/runner/resume.c
+++ b/runner/resume.c
@@ -55,6 +55,8 @@ int main(int argc, char **argv)
 		exitcode = 3;
 	}
 
+	clear_settings(&settings);
+
 	printf("Done.\n");
 	return exitcode;
 }
diff --git a/runner/runner.c b/runner/runner.c
index 4855ad641..258b30b36 100644
--- a/runner/runner.c
+++ b/runner/runner.c
@@ -49,6 +49,8 @@ int main(int argc, char **argv)
 		exitcode = 1;
 	}
 
+	clear_settings(&settings);
+
 	printf("Done.\n");
 	return exitcode;
 }
-- 
2.48.0



More information about the igt-dev mailing list