summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorbp <bp@FreeBSD.org>1999-11-20 03:03:14 +0000
committerbp <bp@FreeBSD.org>1999-11-20 03:03:14 +0000
commitf0d1b4083da7e9aa3f292b8e9c8e4f24e533b087 (patch)
treed6b3938333f2d895dc83dedd021afee7b8aed520 /sys/kern
parentff47533fdbc0032031577cd4c880e280c59cb592 (diff)
downloadFreeBSD-src-f0d1b4083da7e9aa3f292b8e9c8e4f24e533b087.zip
FreeBSD-src-f0d1b4083da7e9aa3f292b8e9c8e4f24e533b087.tar.gz
Vnode was left referenced in the case if ELF image is broken.
Reviewed by: Peter Wemm <peter@netplex.com.au>
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/imgact_elf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 8cb6925..84c4ac6 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -220,8 +220,10 @@ elf_load_section(struct proc *p, struct vmspace *vmspace, struct vnode *vp, vm_o
VM_PROT_ALL,
MAP_COPY_ON_WRITE | MAP_PREFAULT);
vm_map_unlock(&vmspace->vm_map);
- if (rv != KERN_SUCCESS)
+ if (rv != KERN_SUCCESS) {
+ vm_object_deallocate(object);
return EINVAL;
+ }
/* we can stop now if we've covered it all */
if (memsz == filsz)
OpenPOWER on IntegriCloud