🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #976

bug in setvbuf

#976
From: Mike Wescott
Date: Wed, 22 Feb 1989 03:33
12 lines
1089 bytes
In the SysVr3v2 code, setvbuf(fp,buf,type,size) when called with buf==NULL will
malloc() a buffer of size, free()ing the old one if _IOMYBUF is set in
fp->_flags.  As used elsewhere in the stdio code _IOMYBUF is used to indicate
that the buffer has been malloc()ed in the stdio code and should be free()ed at
fclose() or when setvbuf(), or setbuf() overrides.

_IOMYBUF is NOT set in setvbuf when the buffer is malloc()ed. Shouldn't it be?
If not, how would the space get freed? No, I don't think the programmer should
do a free(fp->_base).
-- 
	-Mike Wescott
	 mike.wescott@ncrcae.Columbia.NCR.COM
Technical Details
Message-ID: <1575@sauron.Columbia.NCR.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!hplabs!hp-sdd!ncr-sd!ncrcae!sauron!wescott

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!hplabs!hp-sdd!ncr-sd!ncrcae!sauron!wescott
From: wescott@sauron.Columbia.NCR.COM (Mike Wescott)
Newsgroups: comp.bugs.sys5,comp.unix.wizards
Subject: bug in setvbuf
Message-ID: <1575@sauron.Columbia.NCR.COM>
Date: 22 Feb 89 03:33:58 GMT
Reply-To: wescott@sauron.Columbia.NCR.COM (Mike Wescott)
Organization: Tower Uniprocessor Systems, E&M-Columbia, NCR, W Columbia, SC
Lines: 12