dh_exch.c: Add check for OPENSSL_strdup
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Mon, 7 Feb 2022 11:13:43 +0000 (19:13 +0800)
committerTomas Mraz <tomas@openssl.org>
Mon, 14 Feb 2022 09:10:44 +0000 (10:10 +0100)
commitc920020f0bb13f0d2bf0fcad5c7ee63458b633b4
treebfa7773c68d0c68d1f4ba197339e53c689c07bde
parent7585073892af9cffd28b7b5872c2b102b99af807
dh_exch.c: Add check for OPENSSL_strdup

Since the OPENSSL_strdup() may return NULL if allocation
fails, it should be better to check the return value.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17651)
providers/implementations/exchange/dh_exch.c