summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJiasheng Jiang <jiasheng@iscas.ac.cn>2022-06-17 17:44:24 +0800
committerPauli <pauli@openssl.org>2022-06-22 16:56:40 +1000
commita6a2dd9f60b3f3e93de1337ee84f9e8f33bc86a8 (patch)
tree8bab1cee66ce0e6dcad5bb88d0f41ee1d9e49d3a /apps
parente163969d3580e5b797fcebde0d3000302912ef18 (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.c2
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: