Fix a double free in v2i_NAME_CONSTRAINTS()
authortb <tb@openbsd.org>
Fri, 11 Feb 2022 17:37:54 +0000 (17:37 +0000)
committertb <tb@openbsd.org>
Fri, 11 Feb 2022 17:37:54 +0000 (17:37 +0000)
commitfdcc2361390d4977ac672434e0669552ab1ed523
tree0c030a1c71864225d6aa6fa17a10aee856e9f66d
parentc8fdf0711f007111e7770132b9290468b22688e0
Fix a double free in v2i_NAME_CONSTRAINTS()

a2i_GENERAL_NAME() modifies and returns the out argument that was
passed in unless out == NULL, in which case it returns something
freshly allocated. Thus, in v2i_GENERAL_NAME_ex() we must only free
ret if out == NULL so v2i_NAME_CONSTRAINTS() can free correctly.

Issue reported by Volker Schlecht

ok jsing
lib/libcrypto/x509/x509_alt.c