[runtime] Free leaked short-lived MonoType
authorAlexander Kyte <alexmkyte@fastmail.com>
Mon, 21 Mar 2016 22:15:00 +0000 (18:15 -0400)
committerAlexander Kyte <alexmkyte@fastmail.com>
Tue, 22 Mar 2016 17:19:50 +0000 (13:19 -0400)
mono/metadata/metadata.c

index a96f8cee6380ae2adf0e67ff0d5f0c2cddf019ab..d43f029f21844779f333d2026fcce069aff5f0cc 100644 (file)
@@ -3385,6 +3385,10 @@ do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer
                        return FALSE;
 
                type->data.klass = mono_class_from_mono_type (etype);
+
+               if (transient)
+                       mono_metadata_free_type (etype);
+
                g_assert (type->data.klass); //This was previously a check for NULL, but mcfmt should never fail. It can return a borken MonoClass, but should return at least something.
                break;
        }