GNOME Bugzilla – Bug 756759
provider, telepathy: Small leak fixes
Last modified: 2015-10-27 17:45:37 UTC
Here are a few more leak fixes which were found using valgrind. I'm not fully confident about the GoaProviderFactory patch, but valgrind seems happy after this change...
Created attachment 313552 [details] [review] telepathy: Don't leak local GError after showing it There are 2 occurrences in the telepathy backend where a local error is shown if it's set, but then it's never freed, which causes a memory leak.
Created attachment 313553 [details] [review] provider: Fix GoaProviderFactory leak This fixes: ==23326== 24 bytes in 1 blocks are definitely lost in loss record 5,177 of 18,672 ==23326== at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==23326== by 0x1445EFCC: g_malloc (gmem.c:94) ==23326== by 0x14477523: g_slice_alloc (gslice.c:1007) ==23326== by 0x14477563: g_slice_alloc0 (gslice.c:1032) ==23326== by 0x141E0A30: g_type_create_instance (gtype.c:1852) ==23326== by 0x141C7E85: g_object_new_internal (gobject.c:1779) ==23326== by 0x141C8394: g_object_newv (gobject.c:1926) ==23326== by 0x141C7A36: g_object_new (gobject.c:1619) ==23326== by 0x5BB0770: goa_provider_get_all (goaprovider.c:1219) ==23326== by 0x49BB34: add_account (cc-online-accounts-panel.c:779) ==23326== by 0x49BB78: on_toolbar_add_button_clicked (cc-online-accounts-panel.c:789) ==23326== by 0x141C29ED: g_cclosure_marshal_VOID__VOIDv (gmarshal.c:905) ==23326== by 0x141BFBE3: _g_closure_invoke_va (gclosure.c:864) ==23326== by 0x141DA3E7: g_signal_emit_valist (gsignal.c:3292) ==23326== by 0x141DB6CC: g_signal_emit_by_name (gsignal.c:3479) ==23326== by 0x126687D3: button_clicked (gtktoolbutton.c:944) ==23326== by 0x141C29ED: g_cclosure_marshal_VOID__VOIDv (gmarshal.c:905)
Created attachment 313554 [details] [review] telepathy: Don't leak local GError after showing it There are 2 occurrences in the telepathy backend where a local error is shown if it's set, but then it's never freed, which causes a memory leak.
Created attachment 313555 [details] [review] provider: Fix GoaProviderFactory leak This fixes: ==23326== 24 bytes in 1 blocks are definitely lost in loss record 5,177 of 18,672 ==23326== at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==23326== by 0x1445EFCC: g_malloc (gmem.c:94) ==23326== by 0x14477523: g_slice_alloc (gslice.c:1007) ==23326== by 0x14477563: g_slice_alloc0 (gslice.c:1032) ==23326== by 0x141E0A30: g_type_create_instance (gtype.c:1852) ==23326== by 0x141C7E85: g_object_new_internal (gobject.c:1779) ==23326== by 0x141C8394: g_object_newv (gobject.c:1926) ==23326== by 0x141C7A36: g_object_new (gobject.c:1619) ==23326== by 0x5BB0770: goa_provider_get_all (goaprovider.c:1219) ==23326== by 0x49BB34: add_account (cc-online-accounts-panel.c:779) ==23326== by 0x49BB78: on_toolbar_add_button_clicked (cc-online-accounts-panel.c:789) ==23326== by 0x141C29ED: g_cclosure_marshal_VOID__VOIDv (gmarshal.c:905) ==23326== by 0x141BFBE3: _g_closure_invoke_va (gclosure.c:864) ==23326== by 0x141DA3E7: g_signal_emit_valist (gsignal.c:3292) ==23326== by 0x141DB6CC: g_signal_emit_by_name (gsignal.c:3479) ==23326== by 0x126687D3: button_clicked (gtktoolbutton.c:944) ==23326== by 0x141C29ED: g_cclosure_marshal_VOID__VOIDv (gmarshal.c:905)
Review of attachment 313554 [details] [review]: Thanks. Pushed.
Review of attachment 313555 [details] [review]: Thanks. Looks good. ::: src/goabackend/goaprovider.c @@ +1217,3 @@ { GIOExtension *extension = l->data; + GObject *obj = g_object_new (g_io_extension_get_type (extension), NULL); Nit: would be nice to use a pointer to GoaProviderFactory.
Created attachment 314251 [details] [review] provider: Fix GoaProviderFactory leak Committed after tweaking the pointer type.
Pushed to master and all the way down to gnome-3-14.