W3C home > Mailing lists > Public > www-lib@w3.org > January to March 2003

Re: Bug in HTRequest_setOutputStream???

From: Richard Atterer <richard@list03.atterer.net>
Date: Wed, 19 Feb 2003 21:51:42 +0100
To: www-lib@w3.org
Message-ID: <20030219205142.GC3601@nenya.lan>

On Wed, Feb 19, 2003 at 10:27:14AM -0600, Mark Boudreaux wrote:
> target is allocated memory by HTStreamToChunk but then it is allocated
> memory a second time with HTRequest_setOutputStream.
> I may be off base here but from the way I read the code
> HTRequest_setOutputStream should be changed.
> Feedback, corrections, comments?

I don't think your suggested fix is the right solution. You're changing the
behaviour of HTRequest_setOutputStream(), but IMHO the bug is in the post

If you grep for HTRequest_setOutputStream() in the code, it is used in lots
of other places, and all those places rely on the fact that there will be
no attempt to free the stream object. You'd probably get a lot of double
free()s with the change in place. Test it with valgrind!

Maybe the post code should manually do what your changed version of 
HTRequest_setOutputStream() would have done, or (cleaner) there should be 
an alternative version, "HTRequest_setOutputStream_autoFree()".



  __   _
  |_) /|  Richard Atterer     |  CS student at the Technische  |  GnuPG key:
  | \/¯|  http://atterer.net  |  Universität München, Germany  |  0x888354F7
  ¯ '` ¯
Received on Wednesday, 19 February 2003 16:54:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:55 UTC