diff options
author | Nicola Tuveri <nic.tuv@gmail.com> | 2020-06-28 16:07:59 +0200 |
---|---|---|
committer | Nicola Tuveri <nic.tuv@gmail.com> | 2020-07-02 15:45:14 +0200 |
commit | 587e4e53f886cd4d7a8b0eb063b823409e2ed4b9 (patch) | |
tree | 54e261ea9a1168d87965b38ff0799b5f24625759 /crypto/serializer/serializer_pkey.c | |
parent | Free pre_proc_exts in SSL_free() (diff) | |
download | openssl-587e4e53f886cd4d7a8b0eb063b823409e2ed4b9.tar.xz openssl-587e4e53f886cd4d7a8b0eb063b823409e2ed4b9.zip |
Fix memory leaks on OSSL_SERIALIZER_CTX_new_by_EVP_PKEY
Fixes #12303
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12304)
Diffstat (limited to '')
-rw-r--r-- | crypto/serializer/serializer_pkey.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/serializer/serializer_pkey.c b/crypto/serializer/serializer_pkey.c index d612070240..1e7fc3eafb 100644 --- a/crypto/serializer/serializer_pkey.c +++ b/crypto/serializer/serializer_pkey.c @@ -292,8 +292,6 @@ OSSL_SERIALIZER_CTX *OSSL_SERIALIZER_CTX_new_by_EVP_PKEY(const EVP_PKEY *pkey, const OSSL_PROVIDER *desired_prov = EVP_KEYMGMT_provider(keymgmt); OPENSSL_CTX *libctx = ossl_provider_library_context(desired_prov); struct selected_serializer_st sel_data; - OSSL_PROPERTY_LIST *check = ossl_parse_query(libctx, "type=parameters"); - OSSL_PROPERTY_LIST *current_props = NULL; OSSL_SERIALIZER *first = NULL; const char *name; int i; @@ -347,6 +345,9 @@ OSSL_SERIALIZER_CTX *OSSL_SERIALIZER_CTX_new_by_EVP_PKEY(const EVP_PKEY *pkey, ser = first; if (ser != NULL) { + OSSL_PROPERTY_LIST *check = NULL, *current_props = NULL; + + check = ossl_parse_query(libctx, "type=parameters"); current_props = ossl_parse_property(libctx, OSSL_SERIALIZER_properties(ser)); if (ossl_property_match_count(check, current_props) > 0) |