Another news 2.10.1 bug

Piet Beertema piet at mcvax.UUCP
Sat Jan 14 03:04:26 AEST 1984


There's another "forget-to-close" bug in ifuncs.c:

At the start of broadcast() there is an `xfopen("ARTICLE", "r")'
almost immediately followed by a fclose(fp).
Within the next while loop transmit() is called with as one of its
arguments (again) `xfopen("ARTICLE", "r"))'.
Now transmit() can return in several ways without closing the file,
which leaves you with too many open file descriptors when broadcasting
too many systems.
To fix it:
- move the fclose(fp) to after the while loop;
- replace the transmit() call by:
	fseek(fp, 0L, 0);
	transmit(&srec, fp, 1);
- remove the fclose(ifp) from transmit().
-- 
	Piet Beertema
	CWI (Center for Math. & Comp. Science), Amsterdam
	...{decvax,philabs}!mcvax!piet



More information about the Net.bugs mailing list