summaryrefslogtreecommitdiffstats
path: root/crypto/store
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-05-22 14:56:06 +0200
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-05-25 20:59:42 +0200
commit767b86ee52227b1c8e5c783b9c3850fa65338058 (patch)
tree3b6859e4efff6014eccd5f15cd3a37f6623914d2 /crypto/store
parent294beba4ebfbc0b5e7d86e6b11d9f1c37ad26867 (diff)
Allow NULL arg to OSSL_STORE_close()
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11912)
Diffstat (limited to 'crypto/store')
-rw-r--r--crypto/store/store_lib.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/store/store_lib.c b/crypto/store/store_lib.c
index fb8184d2d9..637466ce10 100644
--- a/crypto/store/store_lib.c
+++ b/crypto/store/store_lib.c
@@ -218,7 +218,11 @@ int OSSL_STORE_eof(OSSL_STORE_CTX *ctx)
int OSSL_STORE_close(OSSL_STORE_CTX *ctx)
{
- int loader_ret = ctx->loader->close(ctx->loader_ctx);
+ int loader_ret;
+
+ if (ctx == NULL)
+ return 1;
+ loader_ret = ctx->loader->close(ctx->loader_ctx);
OPENSSL_free(ctx);
return loader_ret;