diff options
author | otto <> | 2019-05-23 06:43:18 +0000 |
---|---|---|
committer | otto <> | 2019-05-23 06:43:18 +0000 |
commit | 92e048bfdf9e27b1e10a7cfa4192630fc846f126 (patch) | |
tree | 4546a3f81309af0d85040a168e6357b3bc3c38f9 /src | |
parent | 5c10bac65a34ef84546e0124015e9e6f0ca92f9b (diff) | |
download | openbsd-92e048bfdf9e27b1e10a7cfa4192630fc846f126.tar.gz openbsd-92e048bfdf9e27b1e10a7cfa4192630fc846f126.tar.bz2 openbsd-92e048bfdf9e27b1e10a7cfa4192630fc846f126.zip |
Only override size of chunk if we're not given the actual length.
Fixes malloc_conceal...freezero with malloc options C and/or G.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libc/stdlib/malloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index ff41f61385..f2e82679e9 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: malloc.c,v 1.260 2019/05/10 15:03:24 otto Exp $ */ | 1 | /* $OpenBSD: malloc.c,v 1.261 2019/05/23 06:43:18 otto Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net> | 3 | * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net> |
4 | * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> | 4 | * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> |
@@ -1371,7 +1371,8 @@ ofree(struct dir_info **argpool, void *p, int clear, int check, size_t argsz) | |||
1371 | REALSIZE(sz, r); | 1371 | REALSIZE(sz, r); |
1372 | if (pool->mmap_flag) { | 1372 | if (pool->mmap_flag) { |
1373 | clear = 1; | 1373 | clear = 1; |
1374 | argsz = sz; | 1374 | if (!check) |
1375 | argsz = sz; | ||
1375 | } | 1376 | } |
1376 | if (check) { | 1377 | if (check) { |
1377 | if (sz <= MALLOC_MAXCHUNK) { | 1378 | if (sz <= MALLOC_MAXCHUNK) { |