diff options
author | marcel <marcel@FreeBSD.org> | 2002-10-19 05:01:54 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2002-10-19 05:01:54 +0000 |
commit | 9d60b8c5426660a1791edeafa40b89335d706633 (patch) | |
tree | addb222ac6142df46d811f0d2ef44f5b5a2ea834 /sys/kern/link_elf.c | |
parent | 6221a0f65ec86c325c91e7cac59c6cdbbd96cc70 (diff) | |
download | FreeBSD-src-9d60b8c5426660a1791edeafa40b89335d706633.zip FreeBSD-src-9d60b8c5426660a1791edeafa40b89335d706633.tar.gz |
In link_elf_load_file(), when SPARSE_MAPPING is defined and we
cannot allocate ef->object, we freed ef before bailing out with
an error. This is wrong because ef=lf and when we have an error
and lf is non-NULL (which holds if we try to alloc ef->object),
we free lf and thus ef as part of the bailing-out.
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r-- | sys/kern/link_elf.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index a2ba84e..596089a 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -671,7 +671,6 @@ link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* resu #ifdef SPARSE_MAPPING ef->object = vm_object_allocate(OBJT_DEFAULT, mapsize >> PAGE_SHIFT); if (ef->object == NULL) { - free(ef, M_LINKER); error = ENOMEM; goto out; } |