From 25aaa98aa249d26391c1994d2de449562c8b8b99 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Fri, 1 May 2015 14:37:16 -0400 Subject: free NULL cleanup -- coda After the finale, the "real" final part. :) Do a recursive grep with "-B1 -w [a-zA-Z0-9_]*_free" to see if any of the preceeding lines are an "if NULL" check that can be removed. Reviewed-by: Tim Hudson --- crypto/conf/conf_def.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'crypto/conf/conf_def.c') diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index bd2e8c096e..0ed06e11b8 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -391,19 +391,17 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) v = NULL; } } - if (buff != NULL) - BUF_MEM_free(buff); + BUF_MEM_free(buff); OPENSSL_free(section); return (1); err: - if (buff != NULL) - BUF_MEM_free(buff); + BUF_MEM_free(buff); OPENSSL_free(section); if (line != NULL) *line = eline; BIO_snprintf(btmp, sizeof btmp, "%ld", eline); ERR_add_error_data(2, "line ", btmp); - if ((h != conf->data) && (conf->data != NULL)) { + if (h != conf->data) { CONF_free(conf->data); conf->data = NULL; } @@ -595,8 +593,7 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from) OPENSSL_free(buf); return (1); err: - if (buf != NULL) - BUF_MEM_free(buf); + BUF_MEM_free(buf); return (0); } -- cgit v1.2.3