This removes some code because we cannot trace the original contributor
to get their agreement for the licence change (original commit
e03ddfae).
After this change there will be numerous failures in the test cases until
someone rewrites the missing code.
All *_free functions should accept a NULL parameter. After this change
the following *_free functions will fail if a NULL parameter is passed:
BIO_ACCEPT_free()
BIO_CONNECT_free()
BN_BLINDING_free()
BN_CTX_free()
BN_MONT_CTX_free()
BN_RECP_CTX_free()
BUF_MEM_free()
COMP_CTX_free()
ERR_STATE_free()
TXT_DB_free()
X509_STORE_free()
ssl3_free()
ssl_cert_free()
SSL_SESSION_free()
SSL_free()
[skip ci]
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5757)
static void BIO_ACCEPT_free(BIO_ACCEPT *a)
{
- if (a == NULL)
- return;
-
OPENSSL_free(a->param_addr);
OPENSSL_free(a->param_serv);
BIO_ADDRINFO_free(a->addr_first);
void BIO_CONNECT_free(BIO_CONNECT *a)
{
- if (a == NULL)
- return;
-
OPENSSL_free(a->param_hostname);
OPENSSL_free(a->param_service);
BIO_ADDRINFO_free(a->addr_first);
void BN_BLINDING_free(BN_BLINDING *r)
{
- if (r == NULL)
- return;
-
BN_free(r->A);
BN_free(r->Ai);
BN_free(r->e);
void BN_CTX_free(BN_CTX *ctx)
{
- if (ctx == NULL)
- return;
#ifdef BN_CTX_DEBUG
{
BN_POOL_ITEM *pool = ctx->pool.head;
void BN_MONT_CTX_free(BN_MONT_CTX *mont)
{
- if (mont == NULL)
- return;
-
BN_clear_free(&(mont->RR));
BN_clear_free(&(mont->N));
BN_clear_free(&(mont->Ni));
void BN_RECP_CTX_free(BN_RECP_CTX *recp)
{
- if (recp == NULL)
- return;
-
BN_free(&(recp->N));
BN_free(&(recp->Nr));
if (recp->flags & BN_FLG_MALLOCED)
void BUF_MEM_free(BUF_MEM *a)
{
- if (a == NULL)
- return;
-
if (a->data != NULL) {
if (a->flags & BUF_MEM_FLAG_SECURE)
OPENSSL_secure_clear_free(a->data, a->max);
void COMP_CTX_free(COMP_CTX *ctx)
{
- if (ctx == NULL)
- return;
-
if (ctx->meth->finish != NULL)
ctx->meth->finish(ctx);
{
int i;
- if (s == NULL)
- return;
-
for (i = 0; i < ERR_NUM_ERRORS; i++) {
err_clear_data(s, i);
}
int i, n;
char **p, *max;
- if (db == NULL)
- return;
-
if (db->index != NULL) {
for (i = db->num_fields - 1; i >= 0; i--)
lh_OPENSSL_STRING_free(db->index[i]);
STACK_OF(X509_LOOKUP) *sk;
X509_LOOKUP *lu;
- if (vfy == NULL)
- return;
-
CRYPTO_DOWN_REF(&vfy->references, &i, vfy->lock);
REF_PRINT_COUNT("X509_STORE", vfy);
if (i > 0)
void ssl3_free(SSL *s)
{
- if (s == NULL || s->s3 == NULL)
+ if (s->s3 == NULL)
return;
ssl3_cleanup_key_block(s);
{
int i;
- if (c == NULL)
- return;
-
CRYPTO_DOWN_REF(&c->references, &i, c->lock);
REF_PRINT_COUNT("CERT", c);
if (i > 0)
{
int i;
- if (s == NULL)
- return;
-
CRYPTO_DOWN_REF(&s->references, &i, s->lock);
REF_PRINT_COUNT("SSL", s);
if (i > 0)
{
int i;
- if (ss == NULL)
- return;
-
CRYPTO_DOWN_REF(&ss->references, &i, ss->lock);
REF_PRINT_COUNT("SSL_SESSION", ss);
if (i > 0)