Free the certificate after checking in checkCertName (#17558) [backport:1.2]

* Fix small leak in checkCertName
* Size is not needed either
* Free the certificate after checking
This commit is contained in:
Danil Yarantsev 2021-03-29 11:49:19 +03:00 • committed by GitHub
commit b36182b0a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -809,6 +809,8 @@ when not defined(nimDisableCertificateValidation) and not defined(windows):
proc X509_check_host*(cert: PX509, name: cstring, namelen: cint, flags:cuint, peername: cstring): cint {.cdecl, dynlib: DLLSSLName, importc.}
proc X509_free*(cert: PX509) {.cdecl, dynlib: DLLSSLName, importc.}
# Certificates store
type PX509_STORE* = SslPtr