From 59f250987e816fa8236a29a184608c7ab7895673 Mon Sep 17 00:00:00 2001 From: wkoszek Date: Mon, 6 Mar 2006 22:31:25 +0000 Subject: 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(-) (limited to 'tools') diff --git a/tools/tools/umastat/umastat.c b/tools/tools/umastat/umastat.c index fb0cdde..626982c 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) -- cgit v1.1