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 754211 - Memory leak in g_file_enumerator_iterate ()
Memory leak in g_file_enumerator_iterate ()
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.44.x
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-08-27 23:15 UTC by K. Adam Christensen
Modified: 2015-08-28 14:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
g_file_enumerator_iterate patch. (1.02 KB, patch)
2015-08-27 23:15 UTC, K. Adam Christensen
none Details | Review

Description K. Adam Christensen 2015-08-27 23:15:23 UTC
Created attachment 310144 [details] [review]
g_file_enumerator_iterate patch.

g_file_enumerator_iterate takes in an option out_info parameter (as long as out_child is used in its place). However, not supplying out_info makes you vulnerable for a memory leak.

Attached is a simple fix -- if the user doesn't want out_info, then free the memory when we're done using it.
Comment 1 Colin Walters 2015-08-28 12:20:17 UTC
Thanks for the patch, looks correct, and I have pushed it.

For future patches, could you generate them with `git format-patch`?  See: https://wiki.gnome.org/GnomeLove/SubmittingPatches

Thanks!
Comment 2 K. Adam Christensen 2015-08-28 14:13:55 UTC
Will do. Thanks!