From 8cc887b6613aa113eae7f350d3698ea1e2f0020e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 9 Feb 2001 02:16:02 +0000 Subject: Added Laurence J. Lane's CR at end of /proc/sys/modprobe removal patch. Fixed FD leak in success case. --- iptables.c | 3 +++ 1 file changed, 3 insertions(+) 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: -- cgit v1.2.3