diff options
author | 2019-05-23 06:43:18 +0000 | |
---|---|---|
committer | 2019-05-23 06:43:18 +0000 | |
commit | fbc4bd4f48faff985c18d573d5b594722ae35518 (patch) | |
tree | 1527850e5805220146e5a4ab316eca15666d81a3 /lib/libc/stdlib/malloc.c | |
parent | match radeondrm and switch DRM_INFO message with device id/asic name to (diff) | |
download | wireguard-openbsd-fbc4bd4f48faff985c18d573d5b594722ae35518.tar.xz wireguard-openbsd-fbc4bd4f48faff985c18d573d5b594722ae35518.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 'lib/libc/stdlib/malloc.c')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index ff41f613857..f2e82679e9d 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.260 2019/05/10 15:03:24 otto Exp $ */ +/* $OpenBSD: malloc.c,v 1.261 2019/05/23 06:43:18 otto Exp $ */ /* * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net> * 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) REALSIZE(sz, r); if (pool->mmap_flag) { clear = 1; - argsz = sz; + if (!check) + argsz = sz; } if (check) { if (sz <= MALLOC_MAXCHUNK) { |