From 02c06d003687ebef2458d5368c08d9215c6502d6 Mon Sep 17 00:00:00 2001 From: Charlie Gordon Date: Fri, 5 Apr 2024 12:06:40 +0200 Subject: [PATCH] fix memory leaks in run-test262 (#345) --- run-test262.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/run-test262.c b/run-test262.c index 4984ae0..61be6cd 100644 --- a/run-test262.c +++ b/run-test262.c @@ -1503,7 +1503,9 @@ void update_stats(JSRuntime *rt, const char *filename) { JS_ComputeMemoryUsage(rt, &stats); if (stats_count++ == 0) { stats_avg = stats_all = stats_min = stats_max = stats; + free(stats_min_filename); stats_min_filename = strdup(filename); + free(stats_max_filename); stats_max_filename = strdup(filename); } else { if (stats_max.malloc_size < stats.malloc_size) { @@ -2178,7 +2180,12 @@ int main(int argc, char **argv) free(harness_dir); free(harness_features); free(harness_exclude); + free(harness_skip_features); free(error_file); + free(error_filename); + free(report_filename); + free(stats_min_filename); + free(stats_max_filename); /* Signal that the error file is out of date. */ return new_errors || changed_errors || fixed_errors;