diff --git a/src/mono/mono/mini/aot-runtime.c b/src/mono/mono/mini/aot-runtime.c index 8822b06f822eb4..71e32ebc3b8b56 100644 --- a/src/mono/mono/mini/aot-runtime.c +++ b/src/mono/mono/mini/aot-runtime.c @@ -2708,8 +2708,10 @@ mono_aot_get_class_from_name (MonoImage *image, const char *name_space, const ch table_size = amodule->class_name_table [0]; table = amodule->class_name_table + 1; - if (table_size == 0) + if (table_size == 0) { + amodule_unlock (amodule); return FALSE; + } if (name_space [0] == '\0') full_name = g_strdup_printf ("%s", name);