W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2000

Memory Leak In HTReqMant.c

From: Mike Tardif <mtardif@JetForm.com>
Date: Thu, 20 Jul 2000 09:58:46 -0400
Message-ID: <111CF63B7D2ED211830000805F65A2FFC01BA3@OTTMAIL2>
To: "'www-lib@w3.org'" <www-lib@w3.org>
Users of HTPutDocumentAnchor() will notice a memory leak in the function

HTPutDocumentAnchor() internally does two calls to
and in the process, looses a reference to a calloc'ed pointer, stored in
I don't really know whose responsibility it is to free up this, but I can
the symptom with the following change in  HTRequest_setOutputStream():

% diff /libwww/library/src/HTReqman.c HTReqman.c
>       /*
>       ** Maybe this is just curing the symptoms, but output_stream
>       ** may be pointing to calloc'ed data, so free things before
>       ** resetting it.
>       ** Mike P. Tardif, Jetform Corp [mailto:mike.tardif@jetform.com].
>       */
>       if (me->output_stream)
>           HTNoFreeStream_delete(me->output_stream);

Mike P. Tardif         "Windows is about as stable 
JetForm Corporation     as a double-decker bus caught
Ottawa, ON K1Z 8R7      in the middle of hurricane 
Vox: +1(613)230-3676    Floyd." -- The Economist
Received on Thursday, 20 July 2000 10:02:05 UTC

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