summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/malloc.c
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2017-08-20 11:06:16 +0000
committerotto <otto@openbsd.org>2017-08-20 11:06:16 +0000
commit85a65ef17920612241829c5f584b0384c3efaa3b (patch)
tree5429e09f7c040eb993cf4a6cb990a0d413ab4a3e /lib/libc/stdlib/malloc.c
parentCheck that we haven't yet reached the end of the string before calling (diff)
downloadwireguard-openbsd-85a65ef17920612241829c5f584b0384c3efaa3b.tar.xz
wireguard-openbsd-85a65ef17920612241829c5f584b0384c3efaa3b.zip
two MALLOC_STATS only tweaks; one from David CARLIER, the other found by clang
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r--lib/libc/stdlib/malloc.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 22f83f35252..c7ef59b6800 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.228 2017/07/10 09:44:16 otto Exp $ */
+/* $OpenBSD: malloc.c,v 1.229 2017/08/20 11:06:16 otto Exp $ */
/*
* Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@@ -293,12 +293,8 @@ wrterror(struct dir_info *d, char *msg, ...)
writev(STDERR_FILENO, iov, 3);
#ifdef MALLOC_STATS
- if (mopts.malloc_stats) {
- int i;
-
- for (i = 0; i < _MALLOC_MUTEXES; i++)
- malloc_dump(STDERR_FILENO, i, mopts.malloc_pool[i]);
- }
+ if (mopts.malloc_stats)
+ malloc_gdump(STDERR_FILENO);
#endif /* MALLOC_STATS */
errno = saved_errno;
@@ -2080,7 +2076,7 @@ err:
#ifdef MALLOC_STATS
struct malloc_leak {
- void (*f)();
+ void *f;
size_t total_size;
int count;
};