Changes between 0.9.1c and 0.9.2
+ *) Make _all_ *_free functions accept a NULL pointer.
+ [Frans Heymans <fheymans@isaserver.be>]
+
*) If a DH key is generated in s3_srvr.c, don't blow it by trying to use
NULL pointers.
[Anonymous <nobody@replay.com>]
void PKCS7_content_free(a)
PKCS7 *a;
{
+ if(a == NULL)
+ return;
+
if (a->asn1 != NULL) Free((char *)a->asn1);
if (a->d.ptr != NULL)
void X509_NAME_free(a)
X509_NAME *a;
{
+ if(a == NULL)
+ return;
+
BUF_MEM_free(a->bytes);
sk_pop_free(a->entries,X509_NAME_ENTRY_free);
Free((char *)a);
{
int i;
+ if(a == NULL)
+ return;
+
if (a->h_aliases != NULL)
{
for (i=0; a->h_aliases[i] != NULL; i++)
void BIO_ACCEPT_free(a)
BIO_ACCEPT *a;
{
+ if(a == NULL)
+ return;
+
if (a->param_addr != NULL) Free(a->param_addr);
if (a->addr != NULL) Free(a->addr);
if (a->bio_chain != NULL) BIO_free(a->bio_chain);
void BIO_CONNECT_free(a)
BIO_CONNECT *a;
{
+ if(a == NULL)
+ return;
+
if (a->param_hostname != NULL)
Free(a->param_hostname);
if (a->param_port != NULL)
void BN_BLINDING_free(r)
BN_BLINDING *r;
{
+ if(r == NULL)
+ return;
+
if (r->A != NULL) BN_free(r->A );
if (r->Ai != NULL) BN_free(r->Ai);
Free(r);
{
int i;
+ if(c == NULL)
+ return;
+
for (i=0; i<BN_CTX_NUM; i++)
BN_clear_free(&(c->bn[i]));
if (c->flags & BN_FLG_MALLOCED)
void BN_MONT_CTX_free(mont)
BN_MONT_CTX *mont;
{
+ if(mont == NULL)
+ return;
+
BN_free(&(mont->RR));
BN_free(&(mont->N));
BN_free(&(mont->Ni));
void BN_RECP_CTX_free(recp)
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(a)
BUF_MEM *a;
{
+ if(a == NULL)
+ return;
+
if (a->data != NULL)
{
memset(a->data,0,(unsigned int)a->max);
{
/* CRYPTO_free_ex_data(rsa_meth,(char *)ctx,&ctx->ex_data); */
+ 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);
err:
BN_clear_free(&m1);
BN_clear_free(&r1);
- if(ctx)
- BN_CTX_free(ctx);
+ BN_CTX_free(ctx);
return(ret);
}
err:
if (m1 != NULL) BN_free(m1);
if (r1 != NULL) BN_free(r1);
- if(ctx != NULL)
- BN_CTX_free(ctx);
+ BN_CTX_free(ctx);
return(ret);
}
int i,n;
char **p,*max;
+ if(db == NULL)
+ return;
+
if (db->index != NULL)
{
for (i=db->num_fields-1; i>=0; i--)
STACK *sk;
X509_LOOKUP *lu;
+ if(vfy == NULL)
+ return;
+
sk=vfy->get_cert_methods;
for (i=0; i<sk_num(sk); i++)
{
{
SSL2_CTX *s2;
+ if(s == NULL)
+ return;
+
s2=s->s2;
if (s2->rbuf != NULL) Free(s2->rbuf);
if (s2->wbuf != NULL) Free(s2->wbuf);
p=s->s3->tmp.key_block;
i=EVP_MD_size(m);
+ // Should be j=exp?min(5,EVP_CIPHER_key_length(c)):EVP_CIPHER_key_length(c); ?? - Ben 30/12/98
j=(exp)?5:EVP_CIPHER_key_length(c);
k=EVP_CIPHER_iv_length(c);
if ( (which == SSL3_CHANGE_CIPHER_CLIENT_WRITE) ||
void ssl3_free(s)
SSL *s;
{
+ if(s == NULL)
+ return;
+
ssl3_cleanup_key_block(s);
if (s->s3->rbuf.buf != NULL)
Free(s->s3->rbuf.buf);
{
int i;
+ if(c == NULL)
+ return;
+
i=CRYPTO_add(&c->references,-1,CRYPTO_LOCK_SSL_CERT);
#ifdef REF_PRINT
REF_PRINT("CERT",c);
{
int i;
+ if(ss == NULL)
+ return;
+
i=CRYPTO_add(&ss->references,-1,CRYPTO_LOCK_SSL_SESSION);
#ifdef REF_PRINT
REF_PRINT("SSL_SESSION",ss);
{
int i;
+ if(s == NULL)
+ return;
+
i=CRYPTO_add(&s->references,-1,CRYPTO_LOCK_SSL);
#ifdef REF_PRINT
REF_PRINT("SSL",s);
{
int i;
+ if(ss == NULL)
+ return;
+
i=CRYPTO_add(&ss->references,-1,CRYPTO_LOCK_SSL_SESSION);
#ifdef REF_PRINT
REF_PRINT("SSL_SESSION",ss);