Skip to content

Commit

Permalink
Fix a merge mistake in engne_list_add
Browse files Browse the repository at this point in the history
master version increments the struct_ref early
and needs to decrement the struct_ref on error,
while 3.1 and 3.0 increment the struct_ref later.

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #22115)
  • Loading branch information
bernd-edlinger committed Sep 15, 2023
1 parent 5b7167a commit bb67dff
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion crypto/engine/eng_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ static int engine_list_add(ENGINE *e)
* The first time the list allocates, we should register the cleanup.
*/
if (!engine_cleanup_add_last(engine_list_cleanup)) {
CRYPTO_DOWN_REF(&e->struct_ref, &ref);
ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
return 0;
}
Expand Down

0 comments on commit bb67dff

Please sign in to comment.