diff options
| author | tb <> | 2018-08-19 20:07:06 +0000 |
|---|---|---|
| committer | tb <> | 2018-08-19 20:07:06 +0000 |
| commit | a855b40c98811868099b7419205858146204e506 (patch) | |
| tree | 2fbb678b11abe2316f790b5da4df1e680b37c0b1 /src | |
| parent | e081c84895470c8464a8df8c8263cc07071bc844 (diff) | |
| download | openbsd-a855b40c98811868099b7419205858146204e506.tar.gz openbsd-a855b40c98811868099b7419205858146204e506.tar.bz2 openbsd-a855b40c98811868099b7419205858146204e506.zip | |
Don't leak a strdup()'ed string on error in do_accept().
CID #154702.
input & ok inoguchi, ok mestre on first version
Diffstat (limited to 'src')
| -rw-r--r-- | src/usr.bin/openssl/s_socket.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/usr.bin/openssl/s_socket.c b/src/usr.bin/openssl/s_socket.c index d3aff1b3bb..62b32d3936 100644 --- a/src/usr.bin/openssl/s_socket.c +++ b/src/usr.bin/openssl/s_socket.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: s_socket.c,v 1.9 2018/02/07 05:47:55 jsing Exp $ */ | 1 | /* $OpenBSD: s_socket.c,v 1.10 2018/08/19 20:07:06 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -276,11 +276,13 @@ do_accept(int acc_sock, int *sock, char **host) | |||
| 276 | if (h2 == NULL) { | 276 | if (h2 == NULL) { |
| 277 | BIO_printf(bio_err, "gethostbyname failure\n"); | 277 | BIO_printf(bio_err, "gethostbyname failure\n"); |
| 278 | close(ret); | 278 | close(ret); |
| 279 | free(*host); | ||
| 279 | return (0); | 280 | return (0); |
| 280 | } | 281 | } |
| 281 | if (h2->h_addrtype != AF_INET) { | 282 | if (h2->h_addrtype != AF_INET) { |
| 282 | BIO_printf(bio_err, "gethostbyname addr is not AF_INET\n"); | 283 | BIO_printf(bio_err, "gethostbyname addr is not AF_INET\n"); |
| 283 | close(ret); | 284 | close(ret); |
| 285 | free(*host); | ||
| 284 | return (0); | 286 | return (0); |
| 285 | } | 287 | } |
| 286 | } | 288 | } |
