tcpdump-mini: merge r18468 to 8.09
[openwrt/svn-archive/archive.git] / net / miniupnpd / patches / 102-iptcrdr_memleaks.patch
1 Index: miniupnpd-1.1/netfilter/iptcrdr.c
2 ===================================================================
3 --- miniupnpd-1.1.orig/netfilter/iptcrdr.c 2008-03-03 02:41:28.000000000 +0100
4 +++ miniupnpd-1.1/netfilter/iptcrdr.c 2009-09-28 21:14:48.000000000 +0200
5 @@ -371,11 +371,21 @@
6 if(h)
7 {
8 r = delete_rule_and_commit(index, &h, "delete_redirect_rule");
9 +#ifdef IPTABLES_143
10 + iptc_free(h);
11 +#else
12 + iptc_free(&h);
13 +#endif
14 }
15 h = iptc_init("filter");
16 if(h && (r == 0))
17 {
18 r = delete_rule_and_commit(index, &h, "delete_filter_rule");
19 +#ifdef IPTABLES_143
20 + iptc_free(h);
21 +#else
22 + iptc_free(&h);
23 +#endif
24 }
25 }
26 del_redirect_desc(eport, proto);
27 @@ -465,20 +475,40 @@
28 {
29 syslog(LOG_ERR, "%s : iptc_is_chain() error : %s\n",
30 logcaller, iptc_strerror(errno));
31 +#ifdef IPTABLES_143
32 + iptc_free(h);
33 +#else
34 + iptc_free(&h);
35 +#endif
36 return -1;
37 }
38 if(!iptc_append_entry(miniupnpd_chain, e, &h))
39 {
40 syslog(LOG_ERR, "%s : iptc_append_entry() error : %s\n",
41 logcaller, iptc_strerror(errno));
42 +#ifdef IPTABLES_143
43 + iptc_free(h);
44 +#else
45 + iptc_free(&h);
46 +#endif
47 return -1;
48 }
49 if(!iptc_commit(&h))
50 {
51 syslog(LOG_ERR, "%s : iptc_commit() error : %s\n",
52 logcaller, iptc_strerror(errno));
53 +#ifdef IPTABLES_143
54 + iptc_free(h);
55 +#else
56 + iptc_free(&h);
57 +#endif
58 return -1;
59 }
60 +#ifdef IPTABLES_143
61 + iptc_free(h);
62 +#else
63 + iptc_free(&h);
64 +#endif
65 return 0;
66 }
67