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 674325 - gupnp-didl-lite-resource.c:get_resolution_info contains a memory leak
gupnp-didl-lite-resource.c:get_resolution_info contains a memory leak
Status: RESOLVED FIXED
Product: gupnp-av
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-04-18 12:16 UTC by Mark Ryan
Modified: 2019-02-22 05:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix a memory leak in gupnp-didl-lite-resource.c:get_resolution_info (1.10 KB, patch)
2012-04-18 12:16 UTC, Mark Ryan
needs-work Details | Review
Version 2 of patch with formatting errors corrected (1.06 KB, patch)
2012-04-18 13:09 UTC, Mark Ryan
committed Details | Review

Description Mark Ryan 2012-04-18 12:16:13 UTC
Created attachment 212288 [details] [review]
Patch to fix a memory leak in gupnp-didl-lite-resource.c:get_resolution_info

The leak can occur if the contents of the resolution tag are incorrectly specified, e.g., <res resolution="10"></res>.  In such a case the vector of strings allocated by get_resolution_info will be leaked.

Please find attached a patch that addresses this issue.  The patch ensures that g_strfreev is invoked to free the string vector even if the contents of the resolution attribute are invalid.
Comment 1 Jens Georg 2012-04-18 12:26:09 UTC
Review of attachment 212288 [details] [review]:

The patch looks completely weird in the review interface. There should be a newline before the goto and the indentation is one-off. Otherwise it's fine
Comment 2 Mark Ryan 2012-04-18 13:09:07 UTC
Created attachment 212291 [details] [review]
Version 2 of patch with formatting errors corrected

Sorry about that.  My editor was configured to insert tabs rather than spaces.  Please find attached a new version of the patch with spaces instead of tabs and the requested new line.