summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debugger.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/debugger.c b/debugger.c
index 3902819..2bbf866 100644
--- a/debugger.c
+++ b/debugger.c
@@ -532,7 +532,9 @@ void dbg_detach(struct process *proc) {
}
free_breakpoints(proc);
- list_remove(proc);
+ if (proc->next) { /* workaround: its invalid to list_remove() if dbg_attach fails */
+ list_remove(proc);
+ }
free(proc);
}