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 712799 - Memory leak when listing Avahi printers
Memory leak when listing Avahi printers
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-11-21 12:27 UTC by Marek Kašík
Modified: 2013-11-26 13:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix memory leak when listing Avahi printers (2.58 KB, patch)
2013-11-21 12:27 UTC, Marek Kašík
committed Details | Review
Fix memory leak when listing Avahi printers (for master) (5.03 KB, patch)
2013-11-22 10:34 UTC, Marek Kašík
committed Details | Review

Description Marek Kašík 2013-11-21 12:27:09 UTC
Created attachment 260422 [details] [review]
Fix memory leak when listing Avahi printers

Return values of g_variant_get_child_value() were not unreffed
correctly together with one value returned by g_variant_get().

There is also one inefficient copy of string from byte array in the same code. It can use g_variant_get_data() instead (not g_variant_get_bytestring() - the array is not zero-terminated).

Attached patch fixes this problem.

Marek
Comment 1 Marek Kašík 2013-11-22 10:34:12 UTC
Created attachment 261224 [details] [review]
Fix memory leak when listing Avahi printers (for master)

This version of the patch is for current master.
Comment 2 Matthias Clasen 2013-11-22 23:53:04 UTC
Review of attachment 261224 [details] [review]:

ok
Comment 3 Marek Kašík 2013-11-25 09:59:07 UTC
Comment on attachment 261224 [details] [review]
Fix memory leak when listing Avahi printers (for master)

Thank you for the review. I've committed the patch to the master.
Comment 4 Marek Kašík 2013-11-25 11:33:10 UTC
Can I push the patch to 3.8 and 3.10 (attachment 260422 [details] [review])?
Comment 5 Matthias Clasen 2013-11-26 12:25:38 UTC
yes, please
Comment 6 Marek Kašík 2013-11-26 13:27:04 UTC
Thanks. I've committed it to 3.8 and 3.10.

Marek