summaryrefslogtreecommitdiff
path: root/security/arirang/files/patch-proxy.c
blob: e48a005aa56ffdefd6642d3f6d270108e588439b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Do not attempt to close the sock we never opened. Use herror() to report
a DNS-failure, not perror().

	-mi

--- proxy.c	2011-05-17 22:19:11.000000000 -0400
+++ proxy.c	2015-03-23 09:46:34.000000000 -0400
@@ -94,15 +94,13 @@
     struct hostent *he;
 
     if ((he = gethostbyname(proxyhost)) == NULL) {
-        perror("proxy host not found");
-        close(sock);  
+        herror("proxy host not found");
         exit(0);
     }
 
 
     if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
         perror("socket");
-        close(sock);
         exit(0);
     }
     http.sin_family = AF_INET;