projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62cc5ff
)
coverity 966576 - close socket in error path
author
Tim Hudson
<tjh@cryptsoft.com>
Mon, 5 May 2014 00:53:39 +0000
(10:53 +1000)
committer
Matt Caswell
<matt@openssl.org>
Thu, 8 May 2014 22:22:28 +0000
(23:22 +0100)
apps/s_socket.c
patch
|
blob
|
history
diff --git
a/apps/s_socket.c
b/apps/s_socket.c
index a7fa28b7d90351449865e916f1e1c6d9fa16148b..b2e0bc8e5dc5197fa9c9ab695e27f8ce4567de35 100644
(file)
--- 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);
}
}