Merge pull request #3240 from alexanderkyte/aot_compiler_leaks
authorZoltan Varga <vargaz@gmail.com>
Wed, 13 Jul 2016 19:03:14 +0000 (15:03 -0400)
committerGitHub <noreply@github.com>
Wed, 13 Jul 2016 19:03:14 +0000 (15:03 -0400)
[runtime] Fix aot compiler leaks

1  2 
mono/mini/aot-compiler.c
mono/mini/method-to-ir.c
mono/mini/mini-llvm.c
mono/mini/mini.c
mono/mini/mini.h

index 1522b040dd3aff366fdf6b8fcadb0169bda100a6,9349265c2879b8d5d29ab4119970d8c9a9078090..6d96c5bcdb356242403d2fc0947dce05464ff333
@@@ -8865,23 -8869,12 +8872,27 @@@ emit_extra_methods (MonoAotCompile *acf
                encode_int (info_offsets [i], p, &p);
        }
        emit_aot_data (acfg, MONO_AOT_TABLE_EXTRA_METHOD_INFO_OFFSETS, "extra_method_info_offsets", buf, p - buf);
+       g_free (buf);
+       g_free (info_offsets);
+       g_ptr_array_free (table, TRUE);
  }     
  
 +static void
 +generate_aotid (guint8* aotid)
 +{
 +      gpointer *rand_handle;
 +      MonoError error;
 +
 +      mono_rand_open ();
 +      rand_handle = mono_rand_init (NULL, 0);
 +
 +      mono_rand_try_get_bytes (rand_handle, aotid, 16, &error);
 +      mono_error_assert_ok (&error);
 +
 +      mono_rand_close (rand_handle);
 +}
 +
  static void
  emit_exception_info (MonoAotCompile *acfg)
  {
Simple merge
Simple merge
Simple merge
Simple merge