From 00d549f80ff89817fc74c11326d92805f234c523 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 23 May 2008 02:00:37 +1200 Subject: [PATCH] Author: Henrik Nordstrom Bug #2350: Memory allocation problem in restoreCapabilities() --- src/tools.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools.cc b/src/tools.cc index 65a6b16eb7..9b5d141a17 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1357,8 +1357,8 @@ static void restoreCapabilities(int keep) { #if defined(_SQUID_LINUX_) && HAVE_SYS_CAPABILITY_H - cap_user_header_t head = (cap_user_header_t) xcalloc(1, sizeof(cap_user_header_t)); - cap_user_data_t cap = (cap_user_data_t) xcalloc(1, sizeof(cap_user_data_t)); + cap_user_header_t head = (cap_user_header_t) xcalloc(1, sizeof(*head)); + cap_user_data_t cap = (cap_user_data_t) xcalloc(1, sizeof(*cap)); head->version = _LINUX_CAPABILITY_VERSION; -- 2.47.2