Memory Leak In HTReqMant.c

Users of HTPutDocumentAnchor() will notice a memory leak in the function
HTRequest_setOutputStream().

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

% diff /libwww/library/src/HTReqman.c HTReqman.c
1104a1105,1112
>       /*
>       ** 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);

Cheers, 
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
mailto:mtardif@jetform.com  
 .

Received on Thursday, 20 July 2000 10:02:05 UTC