diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2022-06-17 17:44:24 +0800 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-06-22 16:56:40 +1000 |
commit | a6a2dd9f60b3f3e93de1337ee84f9e8f33bc86a8 (patch) | |
tree | 8bab1cee66ce0e6dcad5bb88d0f41ee1d9e49d3a /apps | |
parent | e163969d3580e5b797fcebde0d3000302912ef18 (diff) |
apps/s_server.c: Add check for OPENSSL_strdup
As the potential failure of the OPENSSL_strdup(),
it should be better to check the return value and
return error if fails.
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18595)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/s_server.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/s_server.c b/apps/s_server.c index ab13107e9f..c04da1fc68 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -1168,6 +1168,8 @@ int s_server_main(int argc, char *argv[]) case OPT_UNIX: socket_family = AF_UNIX; OPENSSL_free(host); host = OPENSSL_strdup(opt_arg()); + if (host == NULL) + goto end; OPENSSL_free(port); port = NULL; break; case OPT_UNLINK: |