@ -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;
}