]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #2350: Memory allocation problem in restoreCapabilities()
authorHenrik Nordstrom <henrik@henriknordstrom.net>
Tue, 20 May 2008 20:10:48 +0000 (22:10 +0200)
committerHenrik Nordstrom <henrik@henriknordstrom.net>
Tue, 20 May 2008 20:10:48 +0000 (22:10 +0200)
src/tools.cc

index 250adc60d36be043958885c5b3138e1d534c3daa..a076b09f97b104996c5fadf18b7b6d7aa2d996b1 100644 (file)
@@ -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;