merge r17790 to packages_8.09
authorFlorian Fainelli <florian@openwrt.org>
Mon, 28 Sep 2009 19:17:23 +0000 (19:17 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Mon, 28 Sep 2009 19:17:23 +0000 (19:17 +0000)
SVN-Revision: 17791

net/miniupnpd/patches/102-iptcrdr_memleaks.patch [new file with mode: 0644]

diff --git a/net/miniupnpd/patches/102-iptcrdr_memleaks.patch b/net/miniupnpd/patches/102-iptcrdr_memleaks.patch
new file mode 100644 (file)
index 0000000..5af3c05
--- /dev/null
@@ -0,0 +1,67 @@
+Index: miniupnpd-1.1/netfilter/iptcrdr.c
+===================================================================
+--- miniupnpd-1.1.orig/netfilter/iptcrdr.c     2008-03-03 02:41:28.000000000 +0100
++++ miniupnpd-1.1/netfilter/iptcrdr.c  2009-09-28 21:14:48.000000000 +0200
+@@ -371,11 +371,21 @@
+               if(h)
+               {
+                       r = delete_rule_and_commit(index, &h, "delete_redirect_rule");
++#ifdef IPTABLES_143
++                      iptc_free(h);
++#else
++                      iptc_free(&h);
++#endif
+               }
+               h = iptc_init("filter");
+               if(h && (r == 0))
+               {
+                       r = delete_rule_and_commit(index, &h, "delete_filter_rule");
++#ifdef IPTABLES_143
++                      iptc_free(h);
++#else
++                      iptc_free(&h);
++#endif
+               }
+       }
+       del_redirect_desc(eport, proto);
+@@ -465,20 +475,40 @@
+       {
+               syslog(LOG_ERR, "%s : iptc_is_chain() error : %s\n",
+                      logcaller, iptc_strerror(errno));
++#ifdef IPTABLES_143
++              iptc_free(h);
++#else
++              iptc_free(&h);
++#endif
+               return -1;
+       }
+       if(!iptc_append_entry(miniupnpd_chain, e, &h))
+       {
+               syslog(LOG_ERR, "%s : iptc_append_entry() error : %s\n",
+                      logcaller, iptc_strerror(errno));
++#ifdef IPTABLES_143
++              iptc_free(h);
++#else
++              iptc_free(&h);
++#endif
+               return -1;
+       }
+       if(!iptc_commit(&h))
+       {
+               syslog(LOG_ERR, "%s : iptc_commit() error : %s\n",
+                      logcaller, iptc_strerror(errno));
++#ifdef IPTABLES_143
++              iptc_free(h);
++#else
++              iptc_free(&h);
++#endif
+               return -1;
+       }
++#ifdef IPTABLES_143
++      iptc_free(h);
++#else
++      iptc_free(&h);
++#endif
+       return 0;
+ }