summaryrefslogtreecommitdiffstats
path: root/crypto/conf/conf_def.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/conf/conf_def.c')
-rw-r--r--crypto/conf/conf_def.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c
index 5370e06bf9..b6b56cd967 100644
--- a/crypto/conf/conf_def.c
+++ b/crypto/conf/conf_def.c
@@ -233,13 +233,11 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
}
section = OPENSSL_strdup("default");
- if (section == NULL) {
- ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
+ if (section == NULL)
goto err;
- }
if (_CONF_new_data(conf) == 0) {
- ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_CONF, ERR_R_CONF_LIB);
goto err;
}
@@ -425,10 +423,8 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
goto err;
} else if (strcmp(p, "includedir") == 0) {
OPENSSL_free(conf->includedir);
- if ((conf->includedir = OPENSSL_strdup(pval)) == NULL) {
- ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
+ if ((conf->includedir = OPENSSL_strdup(pval)) == NULL)
goto err;
- }
}
/*
@@ -458,7 +454,6 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
include_path = OPENSSL_malloc(newlen);
if (include_path == NULL) {
- ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
OPENSSL_free(include);
goto err;
}
@@ -495,13 +490,13 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
/* push the currently processing BIO onto stack */
if (biosk == NULL) {
if ((biosk = sk_BIO_new_null()) == NULL) {
- ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_CONF, ERR_R_CRYPTO_LIB);
BIO_free(next);
goto err;
}
}
if (!sk_BIO_push(biosk, in)) {
- ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_CONF, ERR_R_CRYPTO_LIB);
BIO_free(next);
goto err;
}
@@ -519,16 +514,12 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
start = eat_ws(conf, p);
trim_ws(conf, start);
- if ((v = OPENSSL_malloc(sizeof(*v))) == NULL) {
- ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
+ if ((v = OPENSSL_malloc(sizeof(*v))) == NULL)
goto err;
- }
v->name = OPENSSL_strdup(pname);
v->value = NULL;
- if (v->name == NULL) {
- ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
+ if (v->name == NULL)
goto err;
- }
if (!str_copy(conf, psection, &(v->value), start))
goto err;
@@ -544,7 +535,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
} else
tv = sv;
if (_CONF_add_string(conf, tv, v) == 0) {
- ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_CONF, ERR_R_CONF_LIB);
goto err;
}
v = NULL;
@@ -757,7 +748,7 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
goto err;
}
if (!BUF_MEM_grow_clean(buf, newsize)) {
- ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_CONF, ERR_R_BUF_LIB);
goto err;
}
while (*p)
@@ -849,10 +840,8 @@ static BIO *get_next_file(const char *path, OPENSSL_DIR_CTX **dirctx)
newlen = pathlen + namelen + 2;
newpath = OPENSSL_zalloc(newlen);
- if (newpath == NULL) {
- ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
+ if (newpath == NULL)
break;
- }
#ifdef OPENSSL_SYS_VMS
/*
* If the given path isn't clear VMS syntax,