summaryrefslogtreecommitdiffstats
path: root/crypto/conf/conf_mod.c
diff options
context:
space:
mode:
authorDmitry-Me <wipedout@yandex.ru>2016-03-09 13:25:07 +0100
committerRichard Levitte <levitte@openssl.org>2016-05-03 12:33:44 +0200
commitb7b8e948014d93e1eb6d954d0799ae68ab0e068b (patch)
tree666b5fcdb7fa600fde7fc629004017e0dd2a1d62 /crypto/conf/conf_mod.c
parentImprove comment (diff)
downloadopenssl-b7b8e948014d93e1eb6d954d0799ae68ab0e068b.tar.xz
openssl-b7b8e948014d93e1eb6d954d0799ae68ab0e068b.zip
Properly own the duplicated string
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/conf/conf_mod.c')
-rw-r--r--crypto/conf/conf_mod.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c
index cef805dfca..604518aef5 100644
--- a/crypto/conf/conf_mod.c
+++ b/crypto/conf/conf_mod.c
@@ -286,8 +286,13 @@ static CONF_MODULE *module_add(DSO *dso, const char *name,
tmod->name = OPENSSL_strdup(name);
tmod->init = ifunc;
tmod->finish = ffunc;
+ if (tmod->name == NULL) {
+ OPENSSL_free(tmod);
+ return NULL;
+ }
if (!sk_CONF_MODULE_push(supported_modules, tmod)) {
+ OPENSSL_free(tmod->name);
OPENSSL_free(tmod);
return NULL;
}