vol: Free vol header on attach_volume_header error

In attach_volume_header, make sure we free the volume's header if
we're returning an error. We take care of the locks and i/o handles in
the immediately preceding block, but for an actual error we don't get
rid of the header. Do so.

Noticed by Tom Keiser.

Change-Id: I97e61700f644066ac1a0e6b45a67dd62c5397034
Reviewed-on: http://gerrit.openafs.org/7325
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Andrew Deason 2012-05-03 16:36:03 -05:00 committed by Derrick Brashear
parent f45ed29d5f
commit ecfd9549fc

View File

@ -3000,6 +3000,9 @@ attach_volume_header(Error *ec, Volume *vp, struct DiskPartition64 *partp,
} }
if (*ec) { if (*ec) {
VOL_LOCK;
FreeVolumeHeader(vp);
VOL_UNLOCK;
return; return;
} }
if (retry) { if (retry) {