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 562230 - possible memory leak in xmlGetGlobalState
possible memory leak in xmlGetGlobalState
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2008-11-25 13:30 UTC by Daniel Zimmermann
Modified: 2009-01-18 15:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (397 bytes, patch)
2008-11-25 13:34 UTC, Daniel Zimmermann
none Details | Review

Description Daniel Zimmermann 2008-11-25 13:30:50 UTC
Please describe the problem:
possible memory leak in the function xmlGetGlobalState().

When the return value from
p = (xmlGlobalStateCleanupHelperParams *) malloc(sizeof(xmlGlobalStateCleanupHelperParams));

is zero so the function return with error but not freed 
xmlGlobalState *tsd
witch is priv. allocated.


Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Daniel Zimmermann 2008-11-25 13:34:48 UTC
Created attachment 123361 [details] [review]
patch

Fix: free memory in xmlFreeGlobalState when p == NULL
Comment 2 Daniel Veillard 2009-01-18 14:58:58 UTC
Okay, makes perfect sense, patch applied and commited,

  thanks a lot !

Daniel
Comment 3 Daniel Veillard 2009-01-18 15:04:55 UTC
Okay, makes perfect sense, patch applied and commited,

  thanks a lot !

Daniel