Browse Source

Only override size of chunk if we're not given the actual length.

Fixes malloc_conceal...freezero with malloc options C and/or G.
OPENBSD_6_6
otto 5 years ago
parent
commit
f5de0f5c27
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/lib/libc/stdlib/malloc.c

+ 3
- 2
src/lib/libc/stdlib/malloc.c View File

@ -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) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> * 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); REALSIZE(sz, r);
if (pool->mmap_flag) { if (pool->mmap_flag) {
clear = 1; clear = 1;
argsz = sz;
if (!check)
argsz = sz;
} }
if (check) { if (check) {
if (sz <= MALLOC_MAXCHUNK) { if (sz <= MALLOC_MAXCHUNK) {


Loading…
Cancel
Save