From ecfd9549fc29cdad8042e830c656caee1363c6cf Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 3 May 2012 16:36:03 -0500 Subject: [PATCH] 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 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/vol/volume.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vol/volume.c b/src/vol/volume.c index eeaa82415d..dc8a4b3dc7 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -3000,6 +3000,9 @@ attach_volume_header(Error *ec, Volume *vp, struct DiskPartition64 *partp, } if (*ec) { + VOL_LOCK; + FreeVolumeHeader(vp); + VOL_UNLOCK; return; } if (retry) {