aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/engine
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-06-04 00:15:19 +0200
committerMatt Caswell <matt@openssl.org>2016-06-23 14:03:29 +0100
commit3c82e437bb3af822ea13cd5a24bab0745c556246 (patch)
treefd9f622667bf9080451b96bc82e3715d23c31daa /crypto/engine
parent687b48685931638ca5fca2a7d5e13516ad40ea4b (diff)
downloadopenssl-3c82e437bb3af822ea13cd5a24bab0745c556246.tar.gz
Add checks on sk_TYPE_push() returned result
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/engine')
-rw-r--r--crypto/engine/eng_dyn.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/engine/eng_dyn.c b/crypto/engine/eng_dyn.c
index 718599f6d9..843226c077 100644
--- a/crypto/engine/eng_dyn.c
+++ b/crypto/engine/eng_dyn.c
@@ -349,11 +349,15 @@ static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void))
}
{
char *tmp_str = OPENSSL_strdup(p);
- if (!tmp_str) {
+ if (tmp_str == NULL) {
+ ENGINEerr(ENGINE_F_DYNAMIC_CTRL, ERR_R_MALLOC_FAILURE);
+ return 0;
+ }
+ if (!sk_OPENSSL_STRING_push(ctx->dirs, tmp_str)) {
+ OPENSSL_free(tmp_str);
ENGINEerr(ENGINE_F_DYNAMIC_CTRL, ERR_R_MALLOC_FAILURE);
return 0;
}
- sk_OPENSSL_STRING_insert(ctx->dirs, tmp_str, -1);
}
return 1;
default: