From: Jonas Maebe Date: Sun, 8 Dec 2013 22:05:56 +0000 (+0100) Subject: capi_get_key: check for NULL after allocating key X-Git-Tag: master-pre-reformat~182 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1a08ac71f87ff5fb14a115879e6bcc74f85f08f;p=openssl capi_get_key: check for NULL after allocating key Signed-off-by: Kurt Roeckx Reviewed-by: Richard Levitte --- diff --git a/engines/e_capi.c b/engines/e_capi.c index edcebf1a3f..f7876f3bab 100644 --- a/engines/e_capi.c +++ b/engines/e_capi.c @@ -1498,6 +1498,8 @@ static CAPI_KEY *capi_get_key(CAPI_CTX *ctx, const TCHAR *contname, TCHAR *provn CAPI_KEY *key; DWORD dwFlags = 0; key = OPENSSL_malloc(sizeof(CAPI_KEY)); + if (key == NULL) + return NULL; if (sizeof(TCHAR)==sizeof(char)) CAPI_trace(ctx, "capi_get_key, contname=%s, provname=%s, type=%d\n", contname, provname, ptype);