]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Henrik Nordstrom <henrik@henriknordstrom.net>
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 22 May 2008 14:00:37 +0000 (02:00 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 22 May 2008 14:00:37 +0000 (02:00 +1200)
Bug #2350: Memory allocation problem in restoreCapabilities()

src/tools.cc

index 65a6b16eb7590adccbc4c47687ea4a32b58b246f..9b5d141a17492deff5cb96771150916a9e306470 100644 (file)
@@ -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;