summaryrefslogtreecommitdiffstats
path: root/crypto/conf/conf_def.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-05-01 10:02:07 -0400
committerRich Salz <rsalz@openssl.org>2015-05-01 10:02:07 -0400
commitb548a1f11c06ccdfa4f52a539912d22d77ee309e (patch)
tree37ff8792ddf09e4805aa3ba76b805923d3c52734 /crypto/conf/conf_def.c
parent33fbca83dcd05b77f807fab205c4523b8cfe85b5 (diff)
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/conf_def.c')
-rw-r--r--crypto/conf/conf_def.c18
1 files changed, 6 insertions, 12 deletions
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);