From: Dmitry-Me Date: Wed, 9 Mar 2016 12:25:07 +0000 (+0300) Subject: Properly own the duplicated string X-Git-Tag: OpenSSL_1_1_0-pre6~956 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b7b8e948014d93e1eb6d954d0799ae68ab0e068b;p=oweals%2Fopenssl.git Properly own the duplicated string Reviewed-by: Matt Caswell Reviewed-by: Richard Levitte --- 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; }