From: Dr. David von Oheimb Date: Fri, 22 May 2020 12:56:06 +0000 (+0200) Subject: Allow NULL arg to OSSL_STORE_close() X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=767b86ee52227b1c8e5c783b9c3850fa65338058;p=oweals%2Fopenssl.git Allow NULL arg to OSSL_STORE_close() Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11912) --- 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; diff --git a/doc/man3/OSSL_STORE_open.pod b/doc/man3/OSSL_STORE_open.pod index 1e8ebf7ce1..309390efc3 100644 --- a/doc/man3/OSSL_STORE_open.pod +++ b/doc/man3/OSSL_STORE_open.pod @@ -94,6 +94,7 @@ OSSL_STORE_eof() shows that the end of data has been reached. OSSL_STORE_close() takes a B, closes the channel that was opened by OSSL_STORE_open() and frees all other information that was stored in the B, as well as the B itself. +If B is NULL it does nothing. =head1 SUPPORTED SCHEMES