]> git.pld-linux.org Git - packages/autofs.git/blame - autofs-4.1.3-sock-leak-fix.patch
- changes by Kacper Kornet <kornet@camk.edu.pl>
[packages/autofs.git] / autofs-4.1.3-sock-leak-fix.patch
CommitLineData
e3a22658 1--- autofs-4.1.3-devel/lib/rpc_subs.c~ 2004-08-04 13:20:30.000000000 -0400
2+++ autofs-4.1.3-devel/lib/rpc_subs.c 2004-08-18 13:37:14.123571936 -0400
3@@ -34,6 +34,7 @@
4
5 struct conn_info {
6 const char *host;
7+ int fd;
8 unsigned short port;
9 unsigned long program;
10 unsigned long version;
11@@ -48,7 +49,6 @@ struct conn_info {
12 */
13 static CLIENT* create_udp_client(struct conn_info *info)
14 {
15- int fd = -1;
16 CLIENT *client;
17 struct sockaddr_in addr;
18 struct hostent *hp;
19@@ -62,13 +62,14 @@ static CLIENT* create_udp_client(struct
20 if (!hp)
21 return NULL;
22
23+ info->fd = RPC_ANYSOCK;
24 addr.sin_family = AF_INET;
25 addr.sin_port = htons(info->port);
26 memcpy(&addr.sin_addr.s_addr, hp->h_addr, hp->h_length);
27
28 client = clntudp_bufcreate(&addr,
29 info->program, info->version,
30- info->timeout, &fd,
31+ info->timeout, &info->fd,
32 info->send_sz, info->recv_sz);
33
34 return client;
35@@ -169,6 +170,7 @@ static CLIENT* create_tcp_client(struct
36 if (!client)
37 goto out_close;
38
39+ info->fd = fd;
40 return client;
41
42 out_close:
43@@ -214,6 +216,7 @@ static unsigned short portmap_getport(st
44 pmap_info.timeout);
45
46 clnt_destroy(client);
47+ close(pmap_info.fd);
48
49 if (stat != RPC_SUCCESS)
50 return 0;
This page took 0.034312 seconds and 4 git commands to generate.