Fix incorrect sizeof() arguments in allocations
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 15 Feb 2013 11:55:37 +0000 (11:55 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 21 Feb 2013 17:00:26 +0000 (09:00 -0800)
commit6d2d18dfebaea74a30f263e743bdbd1fb14f0580
treecc20cb254f2239ab56635cc7e2f456ad61a8f207
parent03c04c081a170668e52127be3c150582e458e1ed
Fix incorrect sizeof() arguments in allocations

In a number of places we have

struct X *val;
val = malloc(sizeof(struct Y));

If sizeof(struct Y) < sizeof(struct X) this is obviously dangerous,
but it is incorrect regardless of the relative sizes of the
structures. Fix all of the occurences of this that clang points out
to us.

Caught by clang-analyzer

Change-Id: Iad32b4ae460d3f40a45cf33624973bf52fd167d4
Reviewed-on: http://gerrit.openafs.org/9156
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/budb/procs.c
src/libadmin/vos/vosutils.c
src/libafscp/afscp_server.c
src/lwp/iomgr.c
src/rx/rx_multi.c
src/viced/afsfileprocs.c