procctl(PROC_ASLR_STATUS): fix vmspace leak

(cherry picked from commit 0bdb2cbf9d)
This commit is contained in:
Konstantin Belousov 2021-07-15 02:40:04 +03:00
parent 4c78f4997a
commit b1381828c6

View file

@ -509,8 +509,9 @@ aslr_status(struct thread *td, struct proc *p, int *data)
_PHOLD(p);
PROC_UNLOCK(p);
vm = vmspace_acquire_ref(p);
if (vm != NULL && (vm->vm_map.flags & MAP_ASLR) != 0) {
d |= PROC_ASLR_ACTIVE;
if (vm != NULL) {
if ((vm->vm_map.flags & MAP_ASLR) != 0)
d |= PROC_ASLR_ACTIVE;
vmspace_free(vm);
}
PROC_LOCK(p);