From: Henrik Nordstrom Date: Tue, 20 May 2008 20:10:48 +0000 (+0200) Subject: Bug #2350: Memory allocation problem in restoreCapabilities() X-Git-Tag: SQUID_3_1_0_1~49^2~232 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd3cc4b661b2ae56f654251587da77d26a066500;p=thirdparty%2Fsquid.git Bug #2350: Memory allocation problem in restoreCapabilities() --- diff --git a/src/tools.cc b/src/tools.cc index 250adc60d3..a076b09f97 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1256,8 +1256,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;