diff options
| author | liuxueli <[email protected]> | 2021-06-11 14:02:14 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2021-06-11 14:02:14 +0800 |
| commit | 1389716db417a4b52f54fc4a72efb1a578e2ac46 (patch) | |
| tree | fbcf83500dd8dfb16b64d1f036da080b1b69d81e | |
| parent | a181c95ba70f2223087dce5612504ccf78481759 (diff) | |
修复: TSG-6618: 调用X509_get_pubkey后需要使用EVP_PKEY_free进行释放,参照: https://www.openssl.org/docs/man1.1.0/man3/X509_get_pubkey.htmlv2.0.2
| -rw-r--r-- | src/SSL_Certificate.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/SSL_Certificate.c b/src/SSL_Certificate.c index 8ffbbc9..de7312b 100644 --- a/src/SSL_Certificate.c +++ b/src/SSL_Certificate.c @@ -1108,7 +1108,9 @@ UCHAR fn_pGetSSLInfo(char *pcCert, int iLen, ssl_stream *a_ssl_stream, struct a_ssl_stream->stSSLCert->SSLSubKeyLen = i2d_PublicKey(pkey, NULL);; a_ssl_stream->stSSLCert->SSLSubKey = (unsigned char *)dictator_malloc(thread_seq, a_ssl_stream->stSSLCert->SSLSubKeyLen); pkeyLen = i2d_PublicKey(pkey, &(a_ssl_stream->stSSLCert->SSLSubKey)); //!!! point will be changed - a_ssl_stream->stSSLCert->SSLSubKey = a_ssl_stream->stSSLCert->SSLSubKey-a_ssl_stream->stSSLCert->SSLSubKeyLen; + a_ssl_stream->stSSLCert->SSLSubKey = a_ssl_stream->stSSLCert->SSLSubKey-a_ssl_stream->stSSLCert->SSLSubKeyLen; + + EVP_PKEY_free(pkey); } /*validity*/ |
