afs_fetchstore: re-avoid uninitialized variable
authorBenjamin Kaduk <kaduk@mit.edu>
Wed, 5 Feb 2014 23:32:16 +0000 (18:32 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Sat, 8 Feb 2014 22:26:30 +0000 (14:26 -0800)
commitb7326e487f6387033282cc5d1128b00a0456673a
tree919a47925c8e4c76f5d92d048939e19e20984600
parent63291be2216762dd89072f41c9a016608b736ceb
afs_fetchstore: re-avoid uninitialized variable

As noted in the gerrit comments for change 10742, commit
baf6af8a8f2207ce39b746d59ca4bc661c002883 does not handle the case
where the second rx_Read() call fails, and the 'length' variable
can still be used uninitialized.

Instead of using an err label and jumping to it on the case of
errors, initialize length to zero and take care to neither
set nor access *alength if an error has occurred.  This is
more consistent with the style of the surrounding code while still
avoiding the use of an uninitialized variable.

Change-Id: I6abfa4a5f051368ca12ada1494fc7687f378d319
Reviewed-on: http://gerrit.openafs.org/10806
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/afs/afs_fetchstore.c