diff mbox series

[6/6] inline: free symbol list after use

Message ID 20220626130748.74163-7-lucvoo@kernel.org (mailing list archive)
State Mainlined, archived
Headers show
Series cleanup related to inlining of variadic functions | expand

Commit Message

Luc Van Oostenryck June 26, 2022, 1:07 p.m. UTC
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

We usually don't free allocated memory because it's not known
when the allocated objects aren't used anymore.

But here it's pretty obvious, so free this symbol list.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 inline.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/inline.c b/inline.c
index 68f235c21945..a7ab73d37492 100644
--- a/inline.c
+++ b/inline.c
@@ -567,6 +567,7 @@  int inline_function(struct expression *expr, struct symbol *sym)
 	stmt->inline_fn = sym;
 
 	unset_replace_list(fn_symbol_list);
+	free_ptr_list(&fn_symbol_list);
 
 	return 1;
 }