aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/inferiors.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2009-04-30 18:35:55 +0000
committerDoug Evans <dje@google.com>2009-04-30 18:35:55 +0000
commit5091eb23aa99df6443dc559d2da403ba7a24c406 (patch)
tree8c1a8e6b588ce9b02f7b13f7e841976a9866fb3a /gdb/gdbserver/inferiors.c
parentdc621c3587c3f7d6e628812c86dd63c49a34ac72 (diff)
downloadgdb-5091eb23aa99df6443dc559d2da403ba7a24c406.zip
gdb-5091eb23aa99df6443dc559d2da403ba7a24c406.tar.gz
gdb-5091eb23aa99df6443dc559d2da403ba7a24c406.tar.bz2
* inferiors.c (remove_process): Fix memory leak, free process.
* linux-low.c (linux_remove_process): New function. (linux_kill): Call it instead of remove_process. (linux_detach, linux_wait_1): Ditto.
Diffstat (limited to 'gdb/gdbserver/inferiors.c')
-rw-r--r--gdb/gdbserver/inferiors.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
index f96438e..8d44d01 100644
--- a/gdb/gdbserver/inferiors.c
+++ b/gdb/gdbserver/inferiors.c
@@ -427,12 +427,17 @@ add_process (int pid, int attached)
return process;
}
+/* Remove a process from the common process list and free the memory
+ allocated for it.
+ The caller is responsible for freeing private data first. */
+
void
remove_process (struct process_info *process)
{
clear_symbol_cache (&process->symbol_cache);
free_all_breakpoints (process);
remove_inferior (&all_processes, &process->head);
+ free (process);
}
struct process_info *