diff options
author | Tim Hudson <tjh@cryptsoft.com> | 2014-05-05 10:53:39 +1000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2014-05-08 23:22:28 +0100 |
commit | 2fc04cb8728aafe9016569947d64763b5b106594 (patch) | |
tree | ea18acb0fc8ede8aad236f4ac6661b030e1653c6 /apps/s_socket.c | |
parent | 62cc5ff62303e97aeeab38e48b49d46c1e57ce98 (diff) |
coverity 966576 - close socket in error path
Diffstat (limited to 'apps/s_socket.c')
-rw-r--r-- | apps/s_socket.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/s_socket.c b/apps/s_socket.c index a7fa28b7d9..b2e0bc8e5d 100644 --- a/apps/s_socket.c +++ b/apps/s_socket.c @@ -452,6 +452,7 @@ redoit: if ((*host=(char *)OPENSSL_malloc(strlen(h1->h_name)+1)) == NULL) { perror("OPENSSL_malloc"); + closesocket(ret); return(0); } BUF_strlcpy(*host,h1->h_name,strlen(h1->h_name)+1); @@ -460,11 +461,13 @@ redoit: if (h2 == NULL) { BIO_printf(bio_err,"gethostbyname failure\n"); + closesocket(ret); return(0); } if (h2->h_addrtype != AF_INET) { BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n"); + closesocket(ret); return(0); } } |