diff options
author | Wojciech A. Koszek <wkoszek@FreeBSD.org> | 2006-03-06 22:31:25 +0000 |
---|---|---|
committer | Wojciech A. Koszek <wkoszek@FreeBSD.org> | 2006-03-06 22:31:25 +0000 |
commit | 283e3098bbc35ced994b58808e87751a233e5fa1 (patch) | |
tree | 29bb25f4a223ab0b3719e5fa2da6bab9bdcf0d19 /tools/tools/umastat | |
parent | 858494e46166a9a762fa2281f8a9cc37afd74054 (diff) | |
download | src-283e3098bbc35ced994b58808e87751a233e5fa1.tar.gz src-283e3098bbc35ced994b58808e87751a233e5fa1.zip |
Allocate proper amount of memory. Otherwise, we pass the end of a buffer,
thus having unpleasant warning. Was found by jemalloc redzone code.
Reviewed by: rwatson
Approved by: cognet (mentor)
Notes
Notes:
svn path=/head/; revision=156365
Diffstat (limited to 'tools/tools/umastat')
-rw-r--r-- | tools/tools/umastat/umastat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/tools/umastat/umastat.c b/tools/tools/umastat/umastat.c index fb0cdde86208..626982c220e5 100644 --- a/tools/tools/umastat/umastat.c +++ b/tools/tools/umastat/umastat.c @@ -326,7 +326,7 @@ main(int argc, char *argv[]) * it is statically declared as an array of size 1, so we need to * provide additional space. */ - uzp_userspace_len = sizeof(struct uma_zone) + (mp_maxid - 1) * + uzp_userspace_len = sizeof(struct uma_zone) + mp_maxid * sizeof(struct uma_cache); uzp_userspace = malloc(uzp_userspace_len); if (uzp_userspace == NULL) |