]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Added Laurence J. Lane's CR at end of /proc/sys/modprobe removal patch.
authorRusty Russell <rusty@linuxcare.com.au>
Fri, 9 Feb 2001 02:16:02 +0000 (02:16 +0000)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 9 Feb 2001 02:16:02 +0000 (02:16 +0000)
Fixed FD leak in success case.

iptables.c

index c570d3afa26da2a398ba6fd8b244c12a4740fe30..86f1aa1ca2b362977c3b7c91cd05a0a1c74d3d5c 100644 (file)
@@ -1537,6 +1537,9 @@ static char *get_modprobe(void)
                case -1: goto fail;
                case 1024: goto fail; /* Partial read.  Wierd */
                }
+               if (ret[strlen(ret)-1]=='\n') 
+                       ret[strlen(ret)-1]=0;
+               close(procfile);
                return ret;
        }
  fail: