asn1_item_embed_new(): if locking failed, don't call asn1_item_embed_free()
authorRichard Levitte <levitte@openssl.org>
Tue, 24 Oct 2017 16:32:22 +0000 (18:32 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 24 Oct 2017 18:53:04 +0000 (20:53 +0200)
commit9d725c0a1a39dd98b720b41b33fcb969c9c50832
tree2a6a0399a85781f4f4cee90033f4b37425419d8a
parentf7f1ac6cb0a7e96010b1e6273e04ce9e9354601a
asn1_item_embed_new(): if locking failed, don't call asn1_item_embed_free()

asn1_item_embed_free() will try unlocking and fail in this case, and
since the new item was just allocated on the heap, free it directly
with OPENSSL_free() instead.

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 fe6fcd31546db1ab019e55edd15c953c5b358559)
crypto/asn1/tasn_new.c