t-artistik / qtscriptgenerator

Automatically exported from code.google.com/p/qtscriptgenerator
0 stars 0 forks source link

possible memory leak in Handler::startElement in typesystem.cpp #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call Handler::startElement() such that it can return false
2. ...
3. Leaks!

What version of the product are you using? On what operating system?
The code that is checked into the Amarok 2.0 tree. Linux (Kubuntu 8.04 +
backports)

Please provide any additional information below.

At line 428 in typesystem.cpp, the variable element is assigned some
allocated memory. If everything goes OK, that memory gets assigned to
current and there is no leak. If anything goes wrong that memory is never
assigned to current and is leaked when the member function returns false to
the caller.

The attached patch uses an std::auto_ptr to control element until it
releases it to the current assignment.

Original issue reported on code.google.com by erik.e.h...@jpl.nasa.gov on 14 Oct 2008 at 8:30

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Original comment by kentm...@gmail.com on 5 Nov 2008 at 2:17