memory leak in KJS

Harri Porten porten at froglogic.com
Sat Jan 29 02:19:03 GMT 2005


On Fri, 28 Jan 2005, [utf-8] André Wöbbeking wrote:

> x bytes in y blocks are definitely lost
> operator new(unsigned) (vg_replace_malloc.c:133)
> kjsyyparse() (grammar.y:172)
> KJS::Parser::parse(KJS::UChar const*, unsigned, KJS::SourceCode**, int*, KJS::UString*) (internal.cpp:485)

There's one known leak in the parser that occurs when the parser hits a
syntax error. In that case the bison generated will unwind and leave the
memory allocated for string tokens without an owner. Last time I tried to
solve it I realized how difficult it is to do with bison. Having a pool of
strings allocated during parsing (that could be freed in the end if they
are unused might be a possibility).

Harri.





More information about the kde-core-devel mailing list