1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-12-27 02:29:52 +03:00

Fixing a memory leak in SslCertVerifyCallback because of a duplicated callback

This commit is contained in:
Evengard 2020-05-03 05:32:01 +03:00
parent 132926ee09
commit 8fb456f6a6

View File

@ -5701,10 +5701,17 @@ int SslCertVerifyCallback(int preverify_ok, X509_STORE_CTX *ctx)
if (cert != NULL)
{
X *tmpX = X509ToX(cert); // this only wraps cert, but we need to make a copy
X *copyX = CloneX(tmpX);
if (!CompareX(tmpX, clientcert->X))
{
X* copyX = CloneX(tmpX);
if (clientcert->X != NULL)
{
FreeX(clientcert->X);
}
clientcert->X = copyX;
}
tmpX->do_not_free = true; // do not release inner X509 object
FreeX(tmpX);
clientcert->X = copyX;
}
}
}