From: Jonas Maebe Date: Sun, 8 Dec 2013 22:05:23 +0000 (+0100) Subject: capi_cert_get_fname: check for NULL after allocating wfname X-Git-Tag: master-post-reformat~236 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=860732276595f8763b3dfced95476559793c2072;p=oweals%2Fopenssl.git capi_cert_get_fname: check for NULL after allocating wfname Signed-off-by: Kurt Roeckx Reviewed-by: Richard Levitte --- diff --git a/engines/e_capi.c b/engines/e_capi.c index f06d298324..edcebf1a3f 100644 --- a/engines/e_capi.c +++ b/engines/e_capi.c @@ -1333,6 +1333,8 @@ char * capi_cert_get_fname(CAPI_CTX *ctx, PCCERT_CONTEXT cert) if (!CertGetCertificateContextProperty(cert, CERT_FRIENDLY_NAME_PROP_ID, NULL, &dlen)) return NULL; wfname = OPENSSL_malloc(dlen); + if (wfname == NULL) + return NULL; if (CertGetCertificateContextProperty(cert, CERT_FRIENDLY_NAME_PROP_ID, wfname, &dlen)) { char *fname = wide_to_asc(wfname);