From: Amos Jeffries Date: Thu, 22 May 2008 14:00:37 +0000 (+1200) Subject: Author: Henrik Nordstrom X-Git-Tag: SQUID_3_0_STABLE7~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00d549f80ff89817fc74c11326d92805f234c523;p=thirdparty%2Fsquid.git Author: Henrik Nordstrom Bug #2350: Memory allocation problem in restoreCapabilities() --- 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;