Unix CM: Don't free cell, then release lock on it
authorSimon Wilkinson <sxw@your-file-system.com>
Wed, 27 Feb 2013 10:28:05 +0000 (10:28 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 27 Feb 2013 20:44:34 +0000 (12:44 -0800)
commit816b0c76738b7e404c9384a745b58b4d90bfc30d
treedc164d80bbf21db622fae6ce73273ef080986eda
parentce20f1f15103226667bc872378cf9b2e4b3e8cd7
Unix CM: Don't free cell, then release lock on it

If afs_NewCell fails, then we can end up releasing a lock on a
section of memory that we have already freed. As this only happens
if the memory we're operating on is newly allocated and not yet
visible to anyone else, it is safe to release the lock before
starting to tidy things up.

Caught by coverity (#986054)

Change-Id: Ie8651c61790d57a9fd7bbbafcaf78e37b8222bae
Reviewed-on: http://gerrit.openafs.org/9298
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/afs/afs_cell.c