From 3d1f12d56b2702c2568ab19cf286d5498cc4b067 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 19 Nov 2014 20:45:03 +0000 Subject: [PATCH] PR jit/63854: Fix leaks in test-fuzzer.c gcc/testsuite/ChangeLog: PR jit/63854 * jit.dg/test-fuzzer.c (fuzzer_init): Free malloced buffers. (make_random_function): Free ff->locals. From-SVN: r217812 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/jit.dg/test-fuzzer.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bc1435584fc..aa12ff38ddb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-11-19 David Malcolm + + PR jit/63854 + * jit.dg/test-fuzzer.c (fuzzer_init): Free malloced buffers. + (make_random_function): Free ff->locals. + 2014-11-19 Uros Bizjak PR target/63947 diff --git a/gcc/testsuite/jit.dg/test-fuzzer.c b/gcc/testsuite/jit.dg/test-fuzzer.c index f363f8f29a5..b5017923c4a 100644 --- a/gcc/testsuite/jit.dg/test-fuzzer.c +++ b/gcc/testsuite/jit.dg/test-fuzzer.c @@ -105,6 +105,11 @@ fuzzer_init (fuzzer *f, gcc_jit_context *ctxt, unsigned int seed) for (i = 0; i < num_funcs; i++) f->funcs[f->num_funcs++] = make_random_function (f); + + /* Now clean out f. */ + free (f->types); + free (f->funcs); + free (f->globals); } /* Get random int in inclusive range [min, max]. */ @@ -309,6 +314,7 @@ make_random_function (fuzzer *f) gcc_jit_function *result = ff->fn; + free (ff->locals); free (ff->params); free (ff); -- 2.30.2