From 283e3098bbc35ced994b58808e87751a233e5fa1 Mon Sep 17 00:00:00 2001 From: "Wojciech A. Koszek" Date: Mon, 6 Mar 2006 22:31:25 +0000 Subject: [PATCH] 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) --- tools/tools/umastat/umastat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/umastat/umastat.c b/tools/tools/umastat/umastat.c index fb0cdde8620..626982c220e 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)