mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2026-01-19 09:50:13 +03:00
Merge pull request #2200 from synqa/fix-dangling-pointer
Fix dangling pointer
This commit is contained in:
@ -99,6 +99,8 @@ void CheckNetworkAcceptThread(THREAD *thread, void *param)
|
|||||||
|
|
||||||
Disconnect(s);
|
Disconnect(s);
|
||||||
ReleaseSock(s);
|
ReleaseSock(s);
|
||||||
|
|
||||||
|
Free(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -155,15 +157,15 @@ void CheckNetworkListenThread(THREAD *thread, void *param)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CHECK_NETWORK_2 c;
|
CHECK_NETWORK_2 *c;
|
||||||
THREAD *t;
|
THREAD *t;
|
||||||
|
|
||||||
Zero(&c, sizeof(c));
|
c = ZeroMalloc(sizeof(CHECK_NETWORK_2));
|
||||||
c.s = new_sock;
|
c->s = new_sock;
|
||||||
c.k = pri;
|
c->k = pri;
|
||||||
c.x = x;
|
c->x = x;
|
||||||
|
|
||||||
t = NewThread(CheckNetworkAcceptThread, &c);
|
t = NewThread(CheckNetworkAcceptThread, c);
|
||||||
Insert(o, t);
|
Insert(o, t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user