clear np->mem after freeing
This commit is contained in:
parent
21a88dd053
commit
0992df4b90
1 changed files with 1 additions and 0 deletions
1
proc.c
1
proc.c
|
@ -107,6 +107,7 @@ copyproc(struct proc* p)
|
|||
np->kstack = kalloc(KSTACKSIZE);
|
||||
if(np->kstack == 0){
|
||||
kfree(np->mem, np->sz);
|
||||
np->mem = 0;
|
||||
np->state = UNUSED;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue