[aot] Fix leaking a MonoError.
authorZoltan Varga <vargaz@gmail.com>
Thu, 16 Jun 2016 23:07:22 +0000 (19:07 -0400)
committerZoltan Varga <vargaz@gmail.com>
Thu, 16 Jun 2016 23:07:22 +0000 (19:07 -0400)
mono/mini/aot-compiler.c

index 9fb208d4990edc5abac0c75ac37c2894ba71251f..38341964091205e45f88ea770a5d445f933e4c51 100644 (file)
@@ -2725,8 +2725,10 @@ find_typespec_for_class (MonoAotCompile *acfg, MonoClass *klass)
                        MonoError error;
                        int typespec = MONO_TOKEN_TYPE_SPEC | (i + 1);
                        MonoClass *klass_key = mono_class_get_and_inflate_typespec_checked (acfg->image, typespec, NULL, &error);
-                       if (!is_ok (&error))
+                       if (!is_ok (&error)) {
+                               mono_error_cleanup (&error);
                                continue;
+                       }
                        g_hash_table_insert (acfg->typespec_classes, klass_key, GINT_TO_POINTER (typespec));
                }
        }