Add the check after calling OPENSSL_strdup
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Sat, 5 Feb 2022 11:31:11 +0000 (19:31 +0800)
committerPauli <pauli@openssl.org>
Tue, 8 Feb 2022 23:45:12 +0000 (10:45 +1100)
commit09030ee73693411c19b596cb0e0f43eb512ac0e6
tree2fbe88bb3b2598ebf924ca236af0dde4e5138c08
parent29af9fba64fd3e4e086808f2360501b463627ea2
Add the check after calling OPENSSL_strdup

Since the potential failure of the memory allocation, the
OPENSSL_strdup() could return NULL pointer.
Therefore, it should be better to check it in order to guarantee the
success of the configuration, same as the check for
SSL_CTX_set_srp_username().

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17643)
test/helpers/handshake_srp.c