nfs4: Fix PVS V595
Move NULL check for 'fReply' and 'fRequest', since they might be NULL. Change-Id: Icc42b8f24f406d6752c25f4203d6ebe3f6ba0d97 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2168 Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
d38ba84d44
commit
0c481598be
@@ -46,10 +46,13 @@ ReplyBuilder::_InitHeader()
|
|||||||
RPC::CallbackReply*
|
RPC::CallbackReply*
|
||||||
ReplyBuilder::Reply()
|
ReplyBuilder::Reply()
|
||||||
{
|
{
|
||||||
|
if (fReply == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
fReply->Stream().InsertUInt(fStatusPosition, _HaikuErrorToNFS4(fStatus));
|
fReply->Stream().InsertUInt(fStatusPosition, _HaikuErrorToNFS4(fStatus));
|
||||||
fReply->Stream().InsertUInt(fOpCountPosition, fOpCount);
|
fReply->Stream().InsertUInt(fOpCountPosition, fOpCount);
|
||||||
|
|
||||||
if (fReply == NULL || fReply->Stream().Error() == B_OK)
|
if (fReply->Stream().Error() == B_OK)
|
||||||
return fReply;
|
return fReply;
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -806,10 +806,13 @@ RequestBuilder::ReleaseLockOwner(OpenState* state, LockOwner* owner)
|
|||||||
RPC::Call*
|
RPC::Call*
|
||||||
RequestBuilder::Request()
|
RequestBuilder::Request()
|
||||||
{
|
{
|
||||||
|
if (fRequest == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (fProcedure == ProcCompound)
|
if (fProcedure == ProcCompound)
|
||||||
fRequest->Stream().InsertUInt(fOpCountPosition, fOpCount);
|
fRequest->Stream().InsertUInt(fOpCountPosition, fOpCount);
|
||||||
|
|
||||||
if (fRequest == NULL || fRequest->Stream().Error() == B_OK)
|
if (fRequest->Stream().Error() == B_OK)
|
||||||
return fRequest;
|
return fRequest;
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user