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 752939 - Several leak fixes
Several 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-07-27 21:54 UTC by Christophe Fergeau
Modified: 2015-07-29 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
daemon: Fix leak in process_config_entries (1.03 KB, patch)
2015-07-27 21:54 UTC, Christophe Fergeau
committed Details | Review
providers: Fix JsonParser leaks (2.38 KB, patch)
2015-07-27 21:55 UTC, Christophe Fergeau
committed Details | Review
Don't leak account in GoaMediaServerProvider::build_object() (1.02 KB, patch)
2015-07-27 21:55 UTC, Christophe Fergeau
committed Details | Review
owncloud: Fix 'documents' leak in ::build_object() (970 bytes, patch)
2015-07-27 21:55 UTC, Christophe Fergeau
committed Details | Review

Description Christophe Fergeau 2015-07-27 21:54:54 UTC
These patches fix some leaks I found using valgrind
Comment 1 Christophe Fergeau 2015-07-27 21:54:59 UTC
Created attachment 308253 [details] [review]
daemon: Fix leak in process_config_entries

The object returned by g_dbus_object_manager_get_object() must be
unref'ed when no longer needed.
Comment 2 Christophe Fergeau 2015-07-27 21:55:04 UTC
Created attachment 308254 [details] [review]
providers: Fix JsonParser leaks

After creating a JsonParser with json_parser_new(), its memory must be
released with g_object_unref().
Comment 3 Christophe Fergeau 2015-07-27 21:55:10 UTC
Created attachment 308255 [details] [review]
Don't leak account in GoaMediaServerProvider::build_object()

The GoaAccount returned from goa_object_get_account() must be unref'ed
when no longer needed.
Comment 4 Christophe Fergeau 2015-07-27 21:55:15 UTC
Created attachment 308256 [details] [review]
owncloud: Fix 'documents' leak in ::build_object()

Similarly to the calendar, contacts, files objects, 'documents' needs to
be unref'ed when no longer needed.
Comment 5 Debarshi Ray 2015-07-28 15:20:09 UTC
Review of attachment 308253 [details] [review]:

One minor nitpick:

::: src/daemon/goadaemon.c
@@ +634,3 @@
                                             G_CALLBACK (on_account_handle_remove),
                                             self);
+      g_object_unref(object);

Please add a space between the function name and opening parenthesis.
Comment 6 Debarshi Ray 2015-07-28 15:28:00 UTC
Review of attachment 308254 [details] [review]:

::: src/goabackend/goagoogleprovider.c
@@ +262,2 @@
  out:
+  g_clear_object(&parser);

Please put a space between the function name and opening parenthesis.

::: src/goabackend/goawindowsliveprovider.c
@@ +250,2 @@
  out:
+  g_clear_object(&parser);

Ditto.
Comment 7 Debarshi Ray 2015-07-28 15:34:38 UTC
Review of attachment 308255 [details] [review]:

++
Comment 8 Debarshi Ray 2015-07-28 15:36:23 UTC
Review of attachment 308256 [details] [review]:

++
Comment 9 Christophe Fergeau 2015-07-28 20:41:17 UTC
Attachment 308253 [details] pushed as 325f026 - daemon: Fix leak in process_config_entries
Attachment 308254 [details] pushed as 80c89b4 - providers: Fix JsonParser leaks
Attachment 308255 [details] pushed as 53f211c - Don't leak account in GoaMediaServerProvider::build_object()
Comment 10 Christophe Fergeau 2015-07-28 20:42:10 UTC
Attachment 308256 [details] pushed as 0b32f06 - owncloud: Fix 'documents' leak in ::build_object()