diff options
| author | otto <> | 2019-05-23 06:43:18 +0000 |
|---|---|---|
| committer | otto <> | 2019-05-23 06:43:18 +0000 |
| commit | 1deffb2f6064562c73be679de4e1df2baa39ea0d (patch) | |
| tree | 4546a3f81309af0d85040a168e6357b3bc3c38f9 /src/lib/libc/stdlib/malloc.c | |
| parent | 50edb84c5e813afd014aea5768b3b2ae9eb04db3 (diff) | |
| download | openbsd-1deffb2f6064562c73be679de4e1df2baa39ea0d.tar.gz openbsd-1deffb2f6064562c73be679de4e1df2baa39ea0d.tar.bz2 openbsd-1deffb2f6064562c73be679de4e1df2baa39ea0d.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 '')
| -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) { |
