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 702837 - dashdemux: Cleanup use of xmlFree vs g_free
dashdemux: Cleanup use of xmlFree vs g_free
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.x
Other Linux
: Normal normal
: 1.1.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-21 21:54 UTC by Greg Rutz
Modified: 2013-06-26 09:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed fix (12.23 KB, patch)
2013-06-22 22:39 UTC, Greg Rutz
needs-work Details | Review
Updated fix based on comments (20.96 KB, patch)
2013-06-25 16:40 UTC, Greg Rutz
committed Details | Review

Description Greg Rutz 2013-06-21 21:54:00 UTC
In several places in gstmpdparser.c, the code is using g_free() where it should be using xmlFree since the memory was allocated by the libxml2 library.  I will provide a patch shortly.
Comment 1 Greg Rutz 2013-06-22 22:39:36 UTC
Created attachment 247536 [details] [review]
Proposed fix
Comment 2 Thiago Sousa Santos 2013-06-25 01:03:42 UTC
Review of attachment 247536 [details] [review]:

While the bug exists, this patch needs more work. Some of the variables that were switched to being freed by xmlFree were actually created using a g_strdup and should remain being freed with g_free.

Also there is nothing in the xmlFree docs that says how it handles NULL values, while g_free handles it. So switching to xmlFree might also required an "if(variable) xmlFree(variable)"
Comment 3 Greg Rutz 2013-06-25 16:40:31 UTC
Created attachment 247756 [details] [review]
Updated fix based on comments

This updated patch fixes the issues mentioned in Thiago's comments.  It also addresses several other memory allocation/deallocation issues found during my subsequent review
Comment 4 Thiago Sousa Santos 2013-06-26 00:41:41 UTC
Comment on attachment 247756 [details] [review]
Updated fix based on comments

Thanks, pushed.
Comment 5 Thiago Sousa Santos 2013-06-26 00:42:32 UTC
Fixed by commit 45111f2efedd4df58525e93a19342bf306503cff