asn1_item_embed_new(): don't free an embedded item
authorRichard Levitte <levitte@openssl.org>
Tue, 24 Oct 2017 11:39:04 +0000 (13:39 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 24 Oct 2017 18:53:03 +0000 (20:53 +0200)
commitf7f1ac6cb0a7e96010b1e6273e04ce9e9354601a
treee5ccd2acf45bac6bf4c2d12718be834b67e38937
parentb272c48f5669da6b01bdf079bc24e9ef30ea09b3
asn1_item_embed_new(): don't free an embedded item

The previous change with this intention didn't quite do it.  An
embedded item must not be freed itself, but might potentially contain
non-embedded elements, which must be freed.

So instead of calling ASN1_item_ex_free(), where we can't pass the
embed flag, we call asn1_item_embed_free() directly.

This changes asn1_item_embed_free() from being a static function to
being a private non-static function.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/4579)

(cherry picked from commit 03996c19c30575c48b254f10625d24f86058605b)
crypto/asn1/asn1_locl.h
crypto/asn1/tasn_fre.c
crypto/asn1/tasn_new.c