From e85425675158b0b3305d1dde748135080ca0b921 Mon Sep 17 00:00:00 2001 From: otto Date: Sat, 26 Dec 2020 13:17:33 +0000 Subject: 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@ --- libexec/ld.so/malloc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'libexec') 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 * Copyright (c) 2012 Matthew Dempsky @@ -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)) -- cgit v1.2.3-59-g8ed1b