]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
STORE: Fix potential memory leak
authorRichard Levitte <levitte@openssl.org>
Wed, 26 Aug 2020 05:04:53 +0000 (07:04 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 3 Sep 2020 15:48:32 +0000 (17:48 +0200)
When closing an OSSL_STORE_CTX, also clear the passphrase data.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12587)

crypto/store/store_lib.c

index 978cb75af8dfccde2b61bb84dbc74bffd8074723..89efe691da0c1eb89a8051b2cfada0739710538c 100644 (file)
@@ -473,6 +473,7 @@ static int ossl_store_close_it(OSSL_STORE_CTX *ctx)
     sk_OSSL_STORE_INFO_pop_free(ctx->cached_info, OSSL_STORE_INFO_free);
     OSSL_STORE_LOADER_free(ctx->fetched_loader);
     OPENSSL_free(ctx->properties);
+    ossl_pw_clear_passphrase_data(&ctx->pwdata);
     return ret;
 }