Fix unpredictible refcount handling of d2i functions
The passed in reference of a ref-counted object is free'd by d2i functions in the error handling. However if it is not the last reference, the in/out reference variable is not set to null here. This makes it impossible for the caller to handle the error correctly, because there are numerous cases where the passed in reference is free'd and set to null, while in other cases, where the passed in reference is not free'd, the reference is left untouched. Therefore the passed in reference must be set to NULL even when it was not the last reference. Fixes #23713 Reviewed-by:Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by:
Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22809) (cherry picked from commit d550d2aa)
Loading
Please register or sign in to comment