Prechádzať zdrojové kódy

cppcheck issues:

[src/Cedar/Client.c:2184] -> [src/Cedar/Client.c:2187]: (warning) Either the condition 'rpc==0' is redundant or there is possible null pointer dereference: rpc.
[src/Cedar/Client.c:6032] -> [src/Cedar/Client.c:6035]: (warning) Either the condition 'ret!=0' is redundant or there is possible null pointer dereference: ret.
Ilya Shipitsin 9 rokov pred
rodič
commit
d1ea47eb66
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      src/Cedar/Client.c

+ 2 - 2
src/Cedar/Client.c

@@ -2181,13 +2181,13 @@ BUF *CiAccountToCfg(RPC_CLIENT_CREATE_ACCOUNT *t)
 // RPC dispatch routine
 PACK *CiRpcDispatch(RPC *rpc, char *name, PACK *p)
 {
-	CLIENT *c = rpc->Param;
 	PACK *ret;
 	// Validate arguments
 	if (rpc == NULL || name == NULL || p == NULL)
 	{
 		return NULL;
 	}
+	CLIENT *c = rpc->Param;
 
 	ret = NewPack();
 
@@ -6029,11 +6029,11 @@ L_TRY:
 	ReleaseSock(s);
 
 	ret = ZeroMalloc(sizeof(REMOTE_CLIENT));
-	ret->Rpc = rpc;
 	rpc->Param = ret;
 
 	if (ret != NULL)
 	{
+		ret->Rpc = rpc;
 		RPC_CLIENT_VERSION t;
 		Zero(&t, sizeof(t));
 		CcGetClientVersion(ret, &t);