From: Simon Wilkinson Date: Sat, 31 Mar 2012 15:51:19 +0000 (-0400) Subject: vol: Don't return an uninited val from LookupNode X-Git-Tag: upstream/1.8.0_pre1^2~2598 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=6c1a7e68c4859573f636dec9b7e4b2ac1f5bb8a4;p=packages%2Fo%2Fopenafs.git vol: Don't return an uninited val from LookupNode If the SalvageHashTable for a particular node is empty, then LookupNode can return an uninitialised value to the caller. It isn't clear from a broader code inspection whether LookupNode can ever be called with an empty SalvageHashTable, but returning a NULL vsp does seem like the correct thing to do in this situation. Caught by clang-analyzer Change-Id: Ibee79e6acf7d3bdbc2995ef924338ade4de77d08 Reviewed-on: http://gerrit.openafs.org/7094 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/vol/salvsync-server.c b/src/vol/salvsync-server.c index b0458c899..350f4024c 100644 --- a/src/vol/salvsync-server.c +++ b/src/vol/salvsync-server.c @@ -188,7 +188,7 @@ LookupNode(afs_uint32 vid, char * partName, struct SalvageQueueNode ** parent) { struct rx_queue *qp, *nqp; - struct SalvageQueueNode *vsp; + struct SalvageQueueNode *vsp = NULL; int idx = VSHASH(vid); for (queue_Scan(&SalvageHashTable[idx], qp, nqp, rx_queue)) {