]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: handle INTERNALVAR_FUNCTION in clear_internalvar
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 10 Mar 2025 15:10:48 +0000 (11:10 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Wed, 19 Mar 2025 19:15:34 +0000 (15:15 -0400)
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 <guinevere@redhat.com>
gdb/value.c

index 8b8b5c8f4de14f05f2a00704b73372b777561fef..e36feaf81bedf9d33d598cbf15e17e05a0568097 100644 (file)
@@ -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;
     }