lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev [PATCH][dev10] leakage in HTDoConnect


From: Klaus Weide
Subject: Re: lynx-dev [PATCH][dev10] leakage in HTDoConnect
Date: Fri, 8 Oct 1999 03:15:34 -0500 (CDT)

On Thu, 7 Oct 1999, John Bley wrote:

> I'm not really sure if this is the right fix... it
> didn't seem quite right to me: the leak is happening, but
> if I read HTSprint0 correctly it's not meant to be
> used for repeated calls on the same buffer.
> If this is correct, I might have to egrep for other
> potentially incorrect uses of HTSprint0.


Ah so that is where the leaks are coming from that I was seeing.

HTSprintf0 *used to* work fine with an already allocate buffer.
Because these lines that were added before its call to
StrAllocVsprintf it is now leaking:

        if (pstr != 0)
            *pstr = 0;

They shouldn't be necessary, it worked fine without them AFAIK.
See LYListFmtParse in HTFile.c and its use of FormatStr and
FormatNum.  I explicitly made changes there at some time in
the past to let it reuse the buffer (to give HTSprintf a chance
to do less allocating).  That leaks now.

So those two lines should be removed, unless someone knows a
good reason for them.

   Klaus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]