diff --git a/mono/metadata/image.c b/mono/metadata/image.c index 07d7d36208e3..8fb0650b7bd2 100644 --- a/mono/metadata/image.c +++ b/mono/metadata/image.c @@ -1935,6 +1935,7 @@ mono_image_close_except_pools_all (MonoImage**images, int image_count) static void remove_cached_module(gpointer key, gpointer value, gpointer user_data) { + g_free(key); mono_dl_close((MonoDl*)value); } diff --git a/mono/metadata/loader.c b/mono/metadata/loader.c index c7eaba7bda3e..55959f4de1d2 100644 --- a/mono/metadata/loader.c +++ b/mono/metadata/loader.c @@ -1167,6 +1167,7 @@ mono_loader_register_embedded_module (const char *name, MonoDl *module) static void remove_embedded_module (gpointer key, gpointer value, gpointer user_data) { + g_free(key); mono_dl_close((MonoDl*)value); }