GNOME Bugzilla – Bug 766933
GSocketAddress leaks in gnetworkmonitornetlink.c:read_netlink_messages()
Last modified: 2016-07-17 01:15:58 UTC
As claimed by valgrind in a downstream bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1317369 Finally, the log shows this as the most leaking part: 118,864 (25,840 direct, 93,024 indirect) bytes in 646 blocks are definitely lost in loss record 25,430 of 25,505 at 0xF1E9C88: g_type_create_instance (gtype.c:1853) by 0xF1CBB7A: g_object_new_internal (gobject.c:1779) by 0xF1CD460: g_object_newv (gobject.c:1926) by 0xF1CDD93: g_object_new (gobject.c:1619) by 0xEE9D340: g_native_socket_address_new (gnativesocketaddress.c:150) by 0xEEB22D4: g_socket_address_new_from_native (gsocketaddress.c:303) by 0xEEAFA10: cache_recv_address (gsocket.c:4333) by 0xEEAFA10: g_socket_receive_message (gsocket.c:4574) by 0xEEDCD3E: read_netlink_messages (gnetworkmonitornetlink.c:324) by 0xEEACAE0: socket_source_dispatch (gsocket.c:3284) by 0xF452E39: g_main_dispatch (gmain.c:3154) by 0xF452E39: g_main_context_dispatch (gmain.c:3769) by 0xF4531CF: g_main_context_iterate.isra.29 (gmain.c:3840) by 0xF4534F1: g_main_loop_run (gmain.c:4034) The 'addr' variable is leaked there. The downstream bug report is against glib 2.46.2, but I verified that the code is the same in the current git master.
Created attachment 328627 [details] [review] proposed patch
Review of attachment 328627 [details] [review]: LGTM, however in the future would you mind making this a `git format-patch` style patch? See https://wiki.gnome.org/Newcomers/SubmittingPatches You can write one before pushing of course, but I like to review commit messages too.
(In reply to Colin Walters from comment #2) > LGTM, however in the future would you mind making this a `git format-patch` > style patch? See https://wiki.gnome.org/Newcomers/SubmittingPatches It's not made from a checkout, I even do not think I have any writeable. It's only a patch to make things easier for you and save you some time.
(In reply to Milan Crha from comment #3) > (In reply to Colin Walters from comment #2) > > LGTM, however in the future would you mind making this a `git format-patch` > > style patch? See https://wiki.gnome.org/Newcomers/SubmittingPatches > > It's not made from a checkout, I even do not think I have any writeable. > It's only a patch to make things easier for you and save you some time. If you have a GNOME git account, you can commit to glib. There's no per-module ACLs.
The following fix has been pushed: 4215c0c Fix memory leaks in GNetworkMonitorNetlink
Created attachment 331636 [details] [review] Fix memory leaks in GNetworkMonitorNetlink As claimed by valgrind in a downstream bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1317369