[aot] Fix a memory leak related to constraint allocation/deallocation. (#4880)
[mono.git] / mono / mini / aot-runtime.c
index d5ae8dbeece97b2fb080d546eaa4abcf04698354..782106c45e17b519200a104fc6a09695e0e22758 100644 (file)
@@ -505,6 +505,7 @@ decode_klass_ref (MonoAotModule *module, guint8 *buf, guint8 **endbuf, MonoError
                                return NULL;
 
                        t = mini_get_shared_gparam (&par_klass->byval_arg, gshared_constraint);
+                       mono_metadata_free_type (gshared_constraint);
                        klass = mono_class_from_mono_type (t);
                } else {
                        int type = decode_value (p, &p);