From: Simon Marchi Date: Mon, 10 Mar 2025 15:10:48 +0000 (-0400) Subject: gdb: handle INTERNALVAR_FUNCTION in clear_internalvar X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c509b986479147fd29f9abe8438d05c7781b4f29;p=thirdparty%2Fbinutils-gdb.git gdb: handle INTERNALVAR_FUNCTION in clear_internalvar While checking the list of leaks reported by ASan, I found that clear_internalvar doesn't free the internal_function object owned by the internalvar when the internalvar is of kind INTERNALVAR_FUNCTION, fix that. Change-Id: I78f53b83b97bae39370a7b5ba5e1cec70626d66a Reviewed-By: Guinevere Larsen --- diff --git a/gdb/value.c b/gdb/value.c index 8b8b5c8f4de..e36feaf81be 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -2322,6 +2322,10 @@ clear_internalvar (struct internalvar *var) xfree (var->u.string); break; + case INTERNALVAR_FUNCTION: + delete var->u.fn.function; + break; + default: break; }