diff options
author | deraadt <> | 2014-04-19 12:36:03 +0000 |
---|---|---|
committer | deraadt <> | 2014-04-19 12:36:03 +0000 |
commit | eca89bbd1a081780679e4704be88d417a2f743e4 (patch) | |
tree | 11bc97b1f9a1f6b8204f90928fc3c1d2b04a203f /src | |
parent | b92c6bcb136f1266cccf5769ea117ed5e5f190fe (diff) | |
download | openbsd-eca89bbd1a081780679e4704be88d417a2f743e4.tar.gz openbsd-eca89bbd1a081780679e4704be88d417a2f743e4.tar.bz2 openbsd-eca89bbd1a081780679e4704be88d417a2f743e4.zip |
malloc + strlcpy -> strdup
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/src/apps/s_socket.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libssl/src/apps/s_socket.c b/src/lib/libssl/src/apps/s_socket.c index 57015ed8ff..d52714c8c7 100644 --- a/src/lib/libssl/src/apps/s_socket.c +++ b/src/lib/libssl/src/apps/s_socket.c | |||
@@ -302,11 +302,10 @@ redoit: | |||
302 | *host = NULL; | 302 | *host = NULL; |
303 | /* return(0); */ | 303 | /* return(0); */ |
304 | } else { | 304 | } else { |
305 | if ((*host = (char *) malloc(strlen(h1->h_name) + 1)) == NULL) { | 305 | if ((*host = strdup(h1->h_name) == NULL) { |
306 | perror("malloc"); | 306 | perror("strdup"); |
307 | return (0); | 307 | return (0); |
308 | } | 308 | } |
309 | strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1); | ||
310 | 309 | ||
311 | h2 = GetHostByName(*host); | 310 | h2 = GetHostByName(*host); |
312 | if (h2 == NULL) { | 311 | if (h2 == NULL) { |