From f8d463b1031a4086056a39e8268dbb3b1692d49f Mon Sep 17 00:00:00 2001 From: Aleksandr Dovydenkov Date: Mon, 3 Aug 2026 11:58:37 +0300 Subject: [PATCH] Fix memory leak in mono/mini/aot-compiler.c Free GString export_symbols that allocates in add_native_to_managed_wrappers with a minimum size of 16 bytes. Signed-off-by: Aleksandr Dovydenkov Found by Linux Verification Center (linuxtesting.org) with SVACE. --- src/mono/mono/mini/aot-compiler.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index 3b9462c8e17e4c..1475db8aec5932 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -5595,6 +5595,8 @@ MONO_RESTORE_WARNING fprintf (export_symbols_outfile, "%s", export_symbols_out); g_free (export_symbols_out); fclose (export_symbols_outfile); + } else { + g_string_free (export_symbols, TRUE); } }