diff options
| author | deraadt <> | 2014-04-19 12:36:03 +0000 |
|---|---|---|
| committer | deraadt <> | 2014-04-19 12:36:03 +0000 |
| commit | 587440a9cd7aa00ef0e4ed5ee8c42f7bbe8f6549 (patch) | |
| tree | 11bc97b1f9a1f6b8204f90928fc3c1d2b04a203f /src | |
| parent | 529f33014c0c72a3eb49216934efbaca83a77d2f (diff) | |
| download | openbsd-587440a9cd7aa00ef0e4ed5ee8c42f7bbe8f6549.tar.gz openbsd-587440a9cd7aa00ef0e4ed5ee8c42f7bbe8f6549.tar.bz2 openbsd-587440a9cd7aa00ef0e4ed5ee8c42f7bbe8f6549.zip | |
malloc + strlcpy -> strdup
Diffstat (limited to '')
| -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) { |
