bug-global
[Top][All Lists]
Advanced

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

Memory leaks...lots of 'em


From: Jun Inoue
Subject: Memory leaks...lots of 'em
Date: Thu, 31 Mar 2005 03:41:24 -0800

These functions leak memory every time they get called:
common.c:
 gen_page_begin
 gen_href_begin_with_title_target
 encode
src2html.c:
 fill_anchor
 link_format
 generate_guide
 tooltip
htags.c:
 makesearchpart
 makecommonpart

They return strbuf_value, and don't close it.  At least some of them seem
to be intentional, but even if that's the case, it's certainly bad practice.
(Might it be because these codes were copied from Perl and not yet adapted
to C?)
Since the return values for most of these are immediately flushed to files,
why don't we pass a (custom) stream to it?  Later on, if and when the
string is needed, we can implement a "stream" object backed by an on-memory
buffer (or simply read out the string from the stream).

If that is to be approved, I'll be happy to implement it.  Any comments
(or questions)?
-- 
Jun Inoue
address@hidden




reply via email to

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