aboutsummaryrefslogtreecommitdiff
path: root/pcb.c
diff options
context:
space:
mode:
Diffstat (limited to 'pcb.c')
-rw-r--r--pcb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pcb.c b/pcb.c
index 8cffe3f..8f4034a 100644
--- a/pcb.c
+++ b/pcb.c
@@ -146,7 +146,9 @@ int insert_pcb(pcb **queue, pcb * addr, int method) {
current->next = addr;
addr->next = one_after;
addr->prev = current;
- one_after->prev = addr;
+ if (one_after != NULL) {
+ one_after->prev = addr;
+ }
} else {
// otherwise, put it at the head