free proc if kalloc fails
This commit is contained in:
parent
5e392531c0
commit
b48ea5d220
|
@ -116,6 +116,7 @@ found:
|
|||
|
||||
// Allocate a trapframe page.
|
||||
if((p->trapframe = (struct trapframe *)kalloc()) == 0){
|
||||
freeproc(p);
|
||||
release(&p->lock);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue