libafs: don't free a null pointer in an unlikely error condition
authorGarrett Wollman <wollman@csail.mit.edu>
Sat, 13 Aug 2011 23:01:26 +0000 (19:01 -0400)
committerDerrick Brashear <shadow@dementix.org>
Sun, 14 Aug 2011 02:07:45 +0000 (19:07 -0700)
commit5c0e92a159f11366a88adab4700e3f909124a06a
tree0ef9e1ddb4a1e352401099d77db0be35da8f425f
parentee56107d4d168ef07968afeaa7f1c5b39f5c5b23
libafs: don't free a null pointer in an unlikely error condition

It is extremely unlikely that we will ever fail to allocate two
bytes in SRXAFSCB_GetCellServDB() to hold the empty-string return
value for the case where the specified cell can't be found.  But
that would result in freeing a null pointer, so check for it.

Change-Id: I47a296148e231b0ef20ecd18b8458b912f22a58c
Found-by: clang static analyzer with the help of AFS_NONNULL
Reviewed-on: http://gerrit.openafs.org/5261
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/afs/afs_callback.c