Skip to content

Commit

Permalink
Fix potential memory leak in OSSL_IETF_ATTR_SYNTAX_add1_value()
Browse files Browse the repository at this point in the history
The function may leak memory if it deals with an unknown type.
Issue reported by LuMingYinDetect.

Fixes openssl#24452

Reviewed-by: Todd Short <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#24454)
  • Loading branch information
Sashan authored and t8m committed May 30, 2024
1 parent f7ded92 commit cfaa79f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crypto/x509/x_ietfatt.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ int OSSL_IETF_ATTR_SYNTAX_add1_value(OSSL_IETF_ATTR_SYNTAX *a, int type,
val->u.string = data;
break;
default:
OSSL_IETF_ATTR_SYNTAX_VALUE_free(val);
ERR_raise(ERR_LIB_X509V3, ERR_R_PASSED_INVALID_ARGUMENT);
return 0;
}
Expand Down

0 comments on commit cfaa79f

Please sign in to comment.