summaryrefslogtreecommitdiff
path: root/security/arirang/files/patch-proxy.c
blob: 0eecd20e0ba0f389bf35f07dd540f74846eac81e (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.orig	2011-05-18 02:19:11 UTC
+++ proxy.c
@@ -94,15 +94,13 @@ proxy_connect(char *scanhost, unsigned i
     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;