Remove scattered checks for malloc success.
authorNeilBrown <neilb@suse.de>
Mon, 9 Jul 2012 07:14:16 +0000 (17:14 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 9 Jul 2012 07:14:16 +0000 (17:14 +1000)
commit503975b9d5f0696b5d2ee20ea903b859e3f60662
tree171c9f9b9db109325fad7f81ba07671d84a085a5
parentc8e1a230b73c44aff5beeeb74d32e36219bed12d
Remove scattered checks for malloc success.

malloc should never fail, and if it does it is unlikely
that anything else useful can be done.  Best approach is to
abort and let some super-daemon restart.

So define xmalloc, xcalloc, xrealloc, xstrdup which don't
fail but just print a message and exit.  Then use those
removing all the tests for failure.

Also replace all "malloc;memset" sequences with 'xcalloc'.

Signed-off-by: NeilBrown <neilb@suse.de>
33 files changed:
Assemble.c
Create.c
Detail.c
Examine.c
Grow.c
Incremental.c
Manage.c
Monitor.c
bitmap.c
config.c
dlink.c
dlink.h
lib.c
managemon.c
mapfile.c
mdadm.c
mdadm.h
mdmon.c
mdopen.c
mdstat.c
msg.c
platform-intel.c
policy.c
raid6check.c
restripe.c
super-ddf.c
super-gpt.c
super-intel.c
super-mbr.c
super0.c
super1.c
sysfs.c
util.c