fix a potential memory leak
This commit is contained in:
parent
d9160fb4b9
commit
e7ffb74ad1
|
@ -176,7 +176,6 @@ proc_freepagetable(pagetable_t pagetable, uint64 sz)
|
|||
{
|
||||
uvmunmap(pagetable, TRAMPOLINE, PGSIZE, 0);
|
||||
uvmunmap(pagetable, TRAPFRAME, PGSIZE, 0);
|
||||
if(sz > 0)
|
||||
uvmfree(pagetable, sz);
|
||||
}
|
||||
|
||||
|
|
|
@ -301,6 +301,7 @@ freewalk(pagetable_t pagetable)
|
|||
void
|
||||
uvmfree(pagetable_t pagetable, uint64 sz)
|
||||
{
|
||||
if(sz > 0)
|
||||
uvmunmap(pagetable, 0, sz, 1);
|
||||
freewalk(pagetable);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue