1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-23 01:49:53 +03:00

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.
This commit is contained in:
Ilya Shipitsin 2016-04-30 00:26:58 +05:00
parent 29f93371c3
commit d1ea47eb66

View File

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