This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[obv] Fix infcall small memory leak
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Sun, 7 Nov 2010 23:26:19 +0100
- Subject: [obv] Fix infcall small memory leak
Hi,
discard_inferior_thread_state was not updated by me before for the new field
siginfo_data.
No regressions on {x86_64,x86_64-m32,i686}-fedora14snapshot-linux-gnu.
Checked-in.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2010-11/msg00037.html
--- src/gdb/ChangeLog 2010/11/05 16:55:33 1.12300
+++ src/gdb/ChangeLog 2010/11/07 22:25:15 1.12301
@@ -1,3 +1,9 @@
+2010-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * infrun.c (restore_inferior_thread_state): Use
+ discard_inferior_thread_state to free the data.
+ (discard_inferior_thread_state): xfree also siginfo_data.
+
2010-11-05 Doug Evans <dje@google.com>
Make gdb.parameter("directories") work.
--- src/gdb/infrun.c 2010/11/02 01:37:31 1.454
+++ src/gdb/infrun.c 2010/11/07 22:25:16 1.455
@@ -6128,9 +6128,8 @@
if (target_has_execution)
/* NB: The register write goes through to the target. */
regcache_cpy (regcache, inf_state->registers);
- regcache_xfree (inf_state->registers);
- xfree (inf_state->siginfo_data);
- xfree (inf_state);
+
+ discard_inferior_thread_state (inf_state);
}
static void
@@ -6149,6 +6148,7 @@
discard_inferior_thread_state (struct inferior_thread_state *inf_state)
{
regcache_xfree (inf_state->registers);
+ xfree (inf_state->siginfo_data);
xfree (inf_state);
}