From b548a1f11c06ccdfa4f52a539912d22d77ee309e Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Fri, 1 May 2015 10:02:07 -0400 Subject: free null cleanup finale Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte --- crypto/conf/conf_def.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'crypto/conf/conf_def.c') diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index ef3fef4400..bd2e8c096e 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -393,14 +393,12 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) } if (buff != NULL) BUF_MEM_free(buff); - if (section != NULL) - OPENSSL_free(section); + OPENSSL_free(section); return (1); err: if (buff != NULL) BUF_MEM_free(buff); - if (section != NULL) - OPENSSL_free(section); + OPENSSL_free(section); if (line != NULL) *line = eline; BIO_snprintf(btmp, sizeof btmp, "%ld", eline); @@ -410,12 +408,9 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) conf->data = NULL; } if (v != NULL) { - if (v->name != NULL) - OPENSSL_free(v->name); - if (v->value != NULL) - OPENSSL_free(v->value); - if (v != NULL) - OPENSSL_free(v); + OPENSSL_free(v->name); + OPENSSL_free(v->value); + OPENSSL_free(v); } return (0); } @@ -595,8 +590,7 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from) buf->data[to++] = *(from++); } buf->data[to] = '\0'; - if (*pto != NULL) - OPENSSL_free(*pto); + OPENSSL_free(*pto); *pto = buf->data; OPENSSL_free(buf); return (1); -- cgit v1.2.3