From cfabce5ba10ea15158c78bdac732425a46057e42 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 17 Dec 2021 14:54:54 +1030 Subject: [PATCH] asan: abort in wasm_scan_name_function_section Macros like READ_LEB128 in wasm-module.c that alter control flow are evil. Maintainers will break your code if you have hidden ways to reach labels. * wasm-module.c (wasm_scan_name_function_section): Don't attempt to bfd_release NULL. --- bfd/wasm-module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bfd/wasm-module.c b/bfd/wasm-module.c index 9735ebeabca..ca7e38179e9 100644 --- a/bfd/wasm-module.c +++ b/bfd/wasm-module.c @@ -357,7 +357,8 @@ wasm_scan_name_function_section (bfd *abfd, sec_ptr asect) return true; error_return: - bfd_release (abfd, symbols); + if (symbols) + bfd_release (abfd, symbols); return false; } -- 2.30.2