Skip to content

Commit 02c06d0

Browse files
authored
fix memory leaks in run-test262 (#345)
1 parent 8c861c1 commit 02c06d0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

run-test262.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,9 @@ void update_stats(JSRuntime *rt, const char *filename) {
15031503
JS_ComputeMemoryUsage(rt, &stats);
15041504
if (stats_count++ == 0) {
15051505
stats_avg = stats_all = stats_min = stats_max = stats;
1506+
free(stats_min_filename);
15061507
stats_min_filename = strdup(filename);
1508+
free(stats_max_filename);
15071509
stats_max_filename = strdup(filename);
15081510
} else {
15091511
if (stats_max.malloc_size < stats.malloc_size) {
@@ -2178,7 +2180,12 @@ int main(int argc, char **argv)
21782180
free(harness_dir);
21792181
free(harness_features);
21802182
free(harness_exclude);
2183+
free(harness_skip_features);
21812184
free(error_file);
2185+
free(error_filename);
2186+
free(report_filename);
2187+
free(stats_min_filename);
2188+
free(stats_max_filename);
21822189

21832190
/* Signal that the error file is out of date. */
21842191
return new_errors || changed_errors || fixed_errors;

0 commit comments

Comments
 (0)