From: Rusty Russell Date: Fri, 9 Feb 2001 02:16:02 +0000 (+0000) Subject: Added Laurence J. Lane's CR at end of /proc/sys/modprobe removal patch. X-Git-Tag: v1.2.1~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8cc887b6613aa113eae7f350d3698ea1e2f0020e;p=thirdparty%2Fiptables.git Added Laurence J. Lane's CR at end of /proc/sys/modprobe removal patch. Fixed FD leak in success case. --- diff --git a/iptables.c b/iptables.c index c570d3af..86f1aa1c 100644 --- a/iptables.c +++ b/iptables.c @@ -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: