diff options
author | Nicola Tuveri <nic.tuv@gmail.com> | 2020-06-28 17:07:59 +0300 |
---|---|---|
committer | Nicola Tuveri <nic.tuv@gmail.com> | 2020-07-02 16:45:14 +0300 |
commit | 587e4e53f886cd4d7a8b0eb063b823409e2ed4b9 (patch) | |
tree | 54e261ea9a1168d87965b38ff0799b5f24625759 | |
parent | 94941cada25433a7dca35b5b9f8cbb751ab65ab3 (diff) |
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)
-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) |