diff options
author | Rich Salz <rsalz@openssl.org> | 2015-05-01 16:02:07 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-01 16:02:07 +0200 |
commit | b548a1f11c06ccdfa4f52a539912d22d77ee309e (patch) | |
tree | 37ff8792ddf09e4805aa3ba76b805923d3c52734 /crypto/conf | |
parent | Fix some typo's, silence warnings. (diff) | |
download | openssl-b548a1f11c06ccdfa4f52a539912d22d77ee309e.tar.xz openssl-b548a1f11c06ccdfa4f52a539912d22d77ee309e.zip |
free null cleanup finale
Don't check for NULL before calling OPENSSL_free
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/conf')
-rw-r--r-- | crypto/conf/conf_api.c | 3 | ||||
-rw-r--r-- | crypto/conf/conf_def.c | 18 | ||||
-rw-r--r-- | crypto/conf/conf_mod.c | 6 |
3 files changed, 9 insertions, 18 deletions
diff --git a/crypto/conf/conf_api.c b/crypto/conf/conf_api.c index cba2de199b..b41564b680 100644 --- a/crypto/conf/conf_api.c +++ b/crypto/conf/conf_api.c @@ -273,8 +273,7 @@ CONF_VALUE *_CONF_new_section(CONF *conf, const char *section) if (!ok) { if (sk != NULL) sk_CONF_VALUE_free(sk); - if (v != NULL) - OPENSSL_free(v); + OPENSSL_free(v); v = NULL; } return (v); 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); diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c index 9acfca4f71..ce2b177873 100644 --- a/crypto/conf/conf_mod.c +++ b/crypto/conf/conf_mod.c @@ -383,10 +383,8 @@ static int module_init(CONF_MODULE *pmod, char *name, char *value, memerr: if (imod) { - if (imod->name) - OPENSSL_free(imod->name); - if (imod->value) - OPENSSL_free(imod->value); + OPENSSL_free(imod->name); + OPENSSL_free(imod->value); OPENSSL_free(imod); } |