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:11:12 +0000 (10:11 +0100)
commit3948abaf4458aac66bf47546874d0fb5a73a78a0
treeb4e4b36cb5e2bebb3dc790861c93cd4713100c3f
parent88177b8092fb592508bb3798a05025c8bf341cc3
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)

(cherry picked from commit c920020f0bb13f0d2bf0fcad5c7ee63458b633b4)
providers/implementations/exchange/dh_exch.c