diff options
author | bp <bp@FreeBSD.org> | 1999-11-20 03:03:14 +0000 |
---|---|---|
committer | bp <bp@FreeBSD.org> | 1999-11-20 03:03:14 +0000 |
commit | f0d1b4083da7e9aa3f292b8e9c8e4f24e533b087 (patch) | |
tree | d6b3938333f2d895dc83dedd021afee7b8aed520 /sys/kern | |
parent | ff47533fdbc0032031577cd4c880e280c59cb592 (diff) | |
download | FreeBSD-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.c | 4 |
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) |