After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 668966 - Memory leak when parsing a Glyphs element fails
Memory leak when parsing a Glyphs element fails
Status: RESOLVED FIXED
Product: libgxps
Classification: Platform
Component: general
0.2.x
Other Linux
: Normal minor
: ---
Assigned To: libgxps maintainers
libgxps maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-29 18:44 UTC by Jason Crain
Modified: 2012-01-30 13:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add error handler to glyphs GMarkupParser (1.21 KB, patch)
2012-01-29 18:44 UTC, Jason Crain
committed Details | Review

Description Jason Crain 2012-01-29 18:44:54 UTC
Created attachment 206367 [details] [review]
add error handler to glyphs GMarkupParser

A GXPSGlyphs struct is leaked when parsing fails for a child element of a Glyphs.

Example:

<Glyphs Fill="#000000"
  FontRenderingEmSize="48"
  OriginX="10" OriginY="50"
  UnicodeString="Hello"
  FontUri="FreeSans.ttf">
   <Glyphs.RenderTransform>
      <invalid />
   </Glyphs.RenderTransform>
</Glyphs>

Parsing is aborted when invalid data is encountered and cleanup code is not run.  This adds a error handler to the glyphs GMarkupParser to free the struct on error.
Comment 1 Carlos Garcia Campos 2012-01-30 13:00:08 UTC
Review of attachment 206367 [details] [review]:

Pushed! Thank you