summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-04-19 12:36:04 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-04-19 12:36:04 +0000
commit5155b0dac48b04e3e1169aefba252aada31e36fe (patch)
treea9059bc40f2202d00b6595850ab4270ccbe0e7a9
parent576e09910ab82916f3a7a56c330e968c9a0dbcbd (diff)
malloc + strlcpy -> strdup
-rw-r--r--lib/libssl/src/apps/s_socket.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libssl/src/apps/s_socket.c b/lib/libssl/src/apps/s_socket.c
index 57015ed8ffc..d52714c8c7f 100644
--- a/lib/libssl/src/apps/s_socket.c
+++ b/lib/libssl/src/apps/s_socket.c
@@ -302,11 +302,10 @@ redoit:
*host = NULL;
/* return(0); */
} else {
- if ((*host = (char *) malloc(strlen(h1->h_name) + 1)) == NULL) {
- perror("malloc");
+ if ((*host = strdup(h1->h_name) == NULL) {
+ perror("strdup");
return (0);
}
- strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1);
h2 = GetHostByName(*host);
if (h2 == NULL) {