From efa7dd64443f246004751bdaa5671bf6836e07ff Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Fri, 1 May 2015 10:15:18 -0400 Subject: free NULL cleanup 11 Don't check for NULL before calling free functions. This gets: ERR_STATE_free ENGINE_free DSO_free CMAC_CTX_free COMP_CTX_free CONF_free NCONF_free NCONF_free_data _CONF_free_data A sk_free use within OBJ_sigid_free TS_TST_INFO_free (rest of TS_ API was okay) Doc update for UI_free (all uses were fine) X509V3_conf_free X509V3_section_free X509V3_string_free Reviewed-by: Richard Levitte --- ssl/t1_enc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'ssl/t1_enc.c') diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index e87d4b3963..5c7fb86a70 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -385,10 +385,8 @@ int tls1_change_cipher_state(SSL *s, int which) dd = s->enc_read_ctx; mac_ctx = ssl_replace_hash(&s->read_hash, NULL); #ifndef OPENSSL_NO_COMP - if (s->expand != NULL) { - COMP_CTX_free(s->expand); - s->expand = NULL; - } + COMP_CTX_free(s->expand); + s->expand = NULL; if (comp != NULL) { s->expand = COMP_CTX_new(comp->method); if (s->expand == NULL) { @@ -425,10 +423,8 @@ int tls1_change_cipher_state(SSL *s, int which) } else mac_ctx = ssl_replace_hash(&s->write_hash, NULL); #ifndef OPENSSL_NO_COMP - if (s->compress != NULL) { - COMP_CTX_free(s->compress); - s->compress = NULL; - } + COMP_CTX_free(s->compress); + s->compress = NULL; if (comp != NULL) { s->compress = COMP_CTX_new(comp->method); if (s->compress == NULL) { -- cgit v1.2.3