diff options
author | Tomas Mraz <tmraz@fedoraproject.org> | 2019-11-13 11:04:08 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-01-26 15:11:11 +0100 |
commit | 5764c3522c417fc775a78df4529e7a6f93379de8 (patch) | |
tree | adc3be9617ccc6cb7af35553a56a4b33dafd388b /providers/implementations/kdfs | |
parent | b897b353dff8138aa838bae9766ecd3de8c03280 (diff) |
krb5kdf: Do not dereference NULL ctx when allocation fails
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13953)
Diffstat (limited to 'providers/implementations/kdfs')
-rw-r--r-- | providers/implementations/kdfs/krb5kdf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/providers/implementations/kdfs/krb5kdf.c b/providers/implementations/kdfs/krb5kdf.c index cdf8a15415..c719dbf259 100644 --- a/providers/implementations/kdfs/krb5kdf.c +++ b/providers/implementations/kdfs/krb5kdf.c @@ -63,8 +63,10 @@ static void *krb5kdf_new(void *provctx) if (!ossl_prov_is_running()) return NULL; - if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL) + if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL) { ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE); + return NULL; + } ctx->provctx = provctx; return ctx; } |