From: Tim Hudson Date: Mon, 5 May 2014 00:53:39 +0000 (+1000) Subject: coverity 966576 - close socket in error path X-Git-Tag: OpenSSL_1_0_1h~54 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9e456a853749de84a7efff1fd4324134ff98187e;p=oweals%2Fopenssl.git coverity 966576 - close socket in error path --- diff --git a/apps/s_socket.c b/apps/s_socket.c index d49837a405..94eb40f3ff 100644 --- a/apps/s_socket.c +++ b/apps/s_socket.c @@ -450,6 +450,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); @@ -458,11 +459,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); } }