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 756759 - provider, telepathy: Small leak fixes
provider, telepathy: Small leak fixes
Status: RESOLVED FIXED
Product: gnome-online-accounts
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Online Accounts maintainer(s)
GNOME Online Accounts maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-10-17 18:43 UTC by Christophe Fergeau
Modified: 2015-10-27 17:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
telepathy: Don't leak local GError after showing it (1.22 KB, patch)
2015-10-17 18:43 UTC, Christophe Fergeau
none Details | Review
provider: Fix GoaProviderFactory leak (2.22 KB, patch)
2015-10-17 18:43 UTC, Christophe Fergeau
none Details | Review
telepathy: Don't leak local GError after showing it (1.27 KB, patch)
2015-10-17 18:46 UTC, Christophe Fergeau
committed Details | Review
provider: Fix GoaProviderFactory leak (2.27 KB, patch)
2015-10-17 18:46 UTC, Christophe Fergeau
committed Details | Review
provider: Fix GoaProviderFactory leak (2.35 KB, patch)
2015-10-27 17:34 UTC, Debarshi Ray
committed Details | Review

Description Christophe Fergeau 2015-10-17 18:43:33 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...
Comment 1 Christophe Fergeau 2015-10-17 18:43:38 UTC
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.
Comment 2 Christophe Fergeau 2015-10-17 18:43:43 UTC
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)
Comment 3 Christophe Fergeau 2015-10-17 18:46:18 UTC
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.
Comment 4 Christophe Fergeau 2015-10-17 18:46:23 UTC
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)
Comment 5 Debarshi Ray 2015-10-27 17:24:33 UTC
Review of attachment 313554 [details] [review]:

Thanks. Pushed.
Comment 6 Debarshi Ray 2015-10-27 17:33:15 UTC
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.
Comment 7 Debarshi Ray 2015-10-27 17:34:13 UTC
Created attachment 314251 [details] [review]
provider: Fix GoaProviderFactory leak

Committed after tweaking the pointer type.
Comment 8 Debarshi Ray 2015-10-27 17:43:16 UTC
Pushed to master and all the way down to gnome-3-14.