diff options
Diffstat (limited to 'pcb.c')
-rw-r--r-- | pcb.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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
|