summaryrefslogtreecommitdiffstats
path: root/crypto/engine/eng_dyn.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/engine/eng_dyn.c')
-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: