free memory twice (awk)

Jim Ziobro z at rocksanne.UUCP
Tue Dec 16 10:28:40 AEST 1986


The 4.3BSD awk program frees memory twice when parsing regular expressions.
This is bogus but the standard unix malloc package does not care.

Though it never mentions it in the manual malloc(3) will not break if handed
a block which was just previously free as long as there was not an intervening
malloc.  There is a comment in the awk code which hints at something like this
but it leaves a lot to be desired:
	freetr(p1);	/* add this when alloc works */

Should you be porting awk watch out for the above line!

//Z\\
Jim Ziobro
ziobro.henr at xerox.com
rocksanne!z



More information about the Comp.unix.wizards mailing list