diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2020-12-26 13:17:34 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2020-12-26 13:17:34 +0000 |
commit | 2346ac7c0b06e7656f1a6fc44b277338a74931ec (patch) | |
tree | 304218a7b764bdc83617c071b5108df3deb4b91d /libexec | |
parent | 7f8532c32b28806b9c231fb39ea80b9ab9655436 (diff) |
Fix a nasty mem leak in ld.so's own malloc. This was hard to diagnose, since
malloc dumping and gdb do not help at all when studying ld.so. In the end
it turns out ot be a simple merge error causing extra mmap calls.
ok miller@ tb@
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ld.so/malloc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libexec/ld.so/malloc.c b/libexec/ld.so/malloc.c index ddbbe225cf2..3dba1283fd2 100644 --- a/libexec/ld.so/malloc.c +++ b/libexec/ld.so/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.30 2019/09/30 03:35:09 guenther Exp $ */ +/* $OpenBSD: malloc.c,v 1.31 2020/12/26 13:17:33 otto Exp $ */ /* * Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net> * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> @@ -582,9 +582,6 @@ omalloc_make_chunks(struct dir_info *d, int bits, int listnum) if (bits == 0 && _dl_mprotect(pp, MALLOC_PAGESIZE, PROT_NONE) < 0) goto err; - bp = alloc_chunk_info(d, bits); - if (bp == NULL) - goto err; bp->page = pp; if (insert(d, (void *)((uintptr_t)pp | (bits + 1)), (uintptr_t)bp)) |