1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 17:39:53 +03:00

Merge pull request #1231 from chipitsine/master

Cedar/Session.c: fix "use after free" in CleanupSession()
This commit is contained in:
Ilya Shipitsin 2020-10-31 22:28:20 +03:00 committed by GitHub
commit 69b4001355
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1223,6 +1223,9 @@ void CleanupSession(SESSION *s)
// Release the client connection options // Release the client connection options
if (s->ClientOption != NULL) if (s->ClientOption != NULL)
{ {
#ifdef OS_UNIX
UnixVLanSetState(s->ClientOption->DeviceName, false);
#endif
Free(s->ClientOption); Free(s->ClientOption);
} }
@ -1278,12 +1281,7 @@ void CleanupSession(SESSION *s)
{ {
FreePacketAdapter(s->PacketAdapter); FreePacketAdapter(s->PacketAdapter);
} }
#ifdef OS_UNIX
if (s->ClientOption != NULL)
{
UnixVLanSetState(s->ClientOption->DeviceName, false);
}
#endif
if (s->OldTraffic != NULL) if (s->OldTraffic != NULL)
{ {
FreeTraffic(s->OldTraffic); FreeTraffic(s->OldTraffic);