mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-23 01:49:53 +03:00
Merge PR #650: resolve several issues identified by coverity
This commit is contained in:
commit
fc0bd44392
@ -276,7 +276,7 @@ UINT EcConnect(char *host, UINT port, char *password, RPC **rpc)
|
|||||||
// RPC server function
|
// RPC server function
|
||||||
PACK *ElRpcServer(RPC *r, char *name, PACK *p)
|
PACK *ElRpcServer(RPC *r, char *name, PACK *p)
|
||||||
{
|
{
|
||||||
EL *e = (EL *)r->Param;
|
EL *e;
|
||||||
PACK *ret;
|
PACK *ret;
|
||||||
UINT err;
|
UINT err;
|
||||||
bool ok;
|
bool ok;
|
||||||
@ -286,6 +286,7 @@ PACK *ElRpcServer(RPC *r, char *name, PACK *p)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = (EL *)r->Param;
|
||||||
ret = NewPack();
|
ret = NewPack();
|
||||||
err = ERR_NO_ERROR;
|
err = ERR_NO_ERROR;
|
||||||
ok = false;
|
ok = false;
|
||||||
|
@ -299,7 +299,7 @@ RPC *NatAdminConnect(CEDAR *cedar, char *hostname, UINT port, void *hashed_passw
|
|||||||
// RPC server function
|
// RPC server function
|
||||||
PACK *NiRpcServer(RPC *r, char *name, PACK *p)
|
PACK *NiRpcServer(RPC *r, char *name, PACK *p)
|
||||||
{
|
{
|
||||||
NAT *n = (NAT *)r->Param;
|
NAT *n;
|
||||||
PACK *ret;
|
PACK *ret;
|
||||||
UINT err;
|
UINT err;
|
||||||
bool ok;
|
bool ok;
|
||||||
@ -309,6 +309,7 @@ PACK *NiRpcServer(RPC *r, char *name, PACK *p)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
n = (NAT *)r->Param;
|
||||||
ret = NewPack();
|
ret = NewPack();
|
||||||
err = ERR_NO_ERROR;
|
err = ERR_NO_ERROR;
|
||||||
ok = false;
|
ok = false;
|
||||||
|
@ -1006,7 +1006,7 @@ void ClientAdditionalConnectChance(SESSION *s)
|
|||||||
(s->NextConnectionTime <= now))
|
(s->NextConnectionTime <= now))
|
||||||
{
|
{
|
||||||
// Start the work to put an additional connection
|
// Start the work to put an additional connection
|
||||||
s->NextConnectionTime = now + (UINT64)(s->ClientOption->AdditionalConnectionInterval * 1000);
|
s->NextConnectionTime = now + s->ClientOption->AdditionalConnectionInterval * (UINT64)1000U;
|
||||||
SessionAdditionalConnect(s);
|
SessionAdditionalConnect(s);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -133,11 +133,10 @@ static EVENT *halt_tick_event = NULL;
|
|||||||
// Get the high-resolution time
|
// Get the high-resolution time
|
||||||
UINT64 TickHighres64()
|
UINT64 TickHighres64()
|
||||||
{
|
{
|
||||||
UINT64 ret = 0;
|
|
||||||
|
|
||||||
#ifdef OS_WIN32
|
#ifdef OS_WIN32
|
||||||
|
|
||||||
ret = (UINT64)(MsGetHiResTimeSpan(MsGetHiResCounter()) * 1000.0f);
|
return (UINT64)(MsGetHiResTimeSpan(MsGetHiResCounter()) * 1000.0f);
|
||||||
|
|
||||||
#else // OS_WIN32
|
#else // OS_WIN32
|
||||||
|
|
||||||
@ -145,7 +144,6 @@ UINT64 TickHighres64()
|
|||||||
|
|
||||||
#endif // OS_WIN32
|
#endif // OS_WIN32
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the Tick value to time
|
// Convert the Tick value to time
|
||||||
|
Loading…
Reference in New Issue
Block a user