Bug in C Checker

Frank Pedroni fdp at ptsfa.UUCP
Fri Feb 26 04:20:06 AEST 1988


When a nested comment is detected, check dumps core. The problem
is in lex.l:

	void cwarn (ln, s)
	int	ln;
	char	*s;
	{
	/*  Give a warning about a comment, including starting line number  */


		char	msg [120];
		(void) sprintf (msg, "%s, starting at line %d,", s, ln);
		warn (msg);
	-->	free (msg); <--
	}

Calling free() without previously calling malloc() screws up the allocation
pointer so that the next call to malloc() dumps core.

Simply delete this line.

	Frank Pedroni
	Pacific Bell
	Concord, CA



More information about the Comp.sources.bugs mailing list