Commit 3d1f12d5 by David Malcolm Committed by David Malcolm

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
parent ba2dbfce
2014-11-19 David Malcolm <dmalcolm@redhat.com>
PR jit/63854
* jit.dg/test-fuzzer.c (fuzzer_init): Free malloced buffers.
(make_random_function): Free ff->locals.
2014-11-19 Uros Bizjak <ubizjak@gmail.com> 2014-11-19 Uros Bizjak <ubizjak@gmail.com>
PR target/63947 PR target/63947
......
...@@ -105,6 +105,11 @@ fuzzer_init (fuzzer *f, gcc_jit_context *ctxt, unsigned int seed) ...@@ -105,6 +105,11 @@ fuzzer_init (fuzzer *f, gcc_jit_context *ctxt, unsigned int seed)
for (i = 0; i < num_funcs; i++) for (i = 0; i < num_funcs; i++)
f->funcs[f->num_funcs++] = make_random_function (f); 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]. */ /* Get random int in inclusive range [min, max]. */
...@@ -309,6 +314,7 @@ make_random_function (fuzzer *f) ...@@ -309,6 +314,7 @@ make_random_function (fuzzer *f)
gcc_jit_function *result = ff->fn; gcc_jit_function *result = ff->fn;
free (ff->locals);
free (ff->params); free (ff->params);
free (ff); free (ff);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment