aboutsummaryrefslogtreecommitdiff
path: root/gdb/procfs.c
diff options
context:
space:
mode:
authorThomas Lord <lord@cygnus>1994-08-05 17:55:46 +0000
committerThomas Lord <lord@cygnus>1994-08-05 17:55:46 +0000
commitcd4104e085374f382bdd22c24d5e42b17f25099c (patch)
treea463c714dfed6464ba2f8c537fb9d2f352e1517b /gdb/procfs.c
parentd375ce178db997dd1eced9c66e8f2bcd67ac752f (diff)
downloadgdb-cd4104e085374f382bdd22c24d5e42b17f25099c.zip
gdb-cd4104e085374f382bdd22c24d5e42b17f25099c.tar.gz
gdb-cd4104e085374f382bdd22c24d5e42b17f25099c.tar.bz2
Don't dereference invalid pointers in procfs_mourn_inferior
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r--gdb/procfs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c
index e1cbf80..637837f 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -3540,14 +3540,19 @@ static void
procfs_mourn_inferior ()
{
struct procinfo *pi;
+ struct procinfo *next_pi;
- for (pi = procinfo_list; pi; pi = pi->next)
- unconditionally_kill_inferior (pi);
+ for (pi = procinfo_list; pi; pi = next_pi)
+ {
+ next_pi = pi->next;
+ unconditionally_kill_inferior (pi);
+ }
unpush_target (&procfs_ops);
generic_mourn_inferior ();
}
+
/* Mark our target-struct as eligible for stray "run" and "attach" commands. */
static int
procfs_can_run ()