fix a potential memory leak

This commit is contained in:
Robert Morris 2019-10-27 13:36:46 -04:00
parent d9160fb4b9
commit e7ffb74ad1
2 changed files with 3 additions and 3 deletions

View file

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

View file

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