修复内存泄漏问题
This commit is contained in:
@@ -292,6 +292,7 @@ static struct keyring_private* get_keyring_from_response(const char* data)
|
||||
return NULL;
|
||||
}
|
||||
sk_X509_push(chain, chain_cert);
|
||||
ssl_x509_refcount_inc(chain_cert);
|
||||
}
|
||||
struct keyring_private* _kyr= keyring_new();
|
||||
keyring_set_cert(_kyr, cert);
|
||||
@@ -328,6 +329,8 @@ static struct keyring_private* generate_x509_keyring(X509* origin_cert, int keyr
|
||||
STACK_OF(X509)* chain = sk_X509_new_null();
|
||||
sk_X509_push(chain, ca);
|
||||
sk_X509_push(chain, forge_cert);
|
||||
ssl_x509_refcount_inc(ca);
|
||||
ssl_x509_refcount_inc(forge_cert);
|
||||
struct keyring_private* _kyr= keyring_new();
|
||||
keyring_set_key(_kyr, forge_key);
|
||||
keyring_set_cert(_kyr, forge_cert);
|
||||
|
||||
@@ -2033,7 +2033,7 @@ struct ssl_chello* ssl_chello_parse(const unsigned char* buff, size_t buff_len,
|
||||
_chello->max_version.major = buff[pos];
|
||||
_chello->max_version.minor = buff[pos+1];
|
||||
_chello->max_version.ossl_format=(uint16_t)_chello->max_version.major<<8|_chello->max_version.minor;
|
||||
|
||||
|
||||
pos += 34;
|
||||
/* Session ID */
|
||||
if (pos + 1 > buff_len)
|
||||
|
||||
@@ -180,6 +180,7 @@ static struct keyring* get_keyring_from_response(const char* data)
|
||||
if(chain_cert)
|
||||
printf("push to chain\n");
|
||||
sk_X509_push(chain, chain_cert);
|
||||
ssl_x509_refcount_inc(chain_cert);
|
||||
}
|
||||
struct keyring_private* _kyr= keyring_new();
|
||||
printf("cert is %s", cert == NULL ? "null" : "not null\n");
|
||||
|
||||
Reference in New Issue
Block a user