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 651468 - return_error_and_list: Possible memory leak
return_error_and_list: Possible memory leak
Status: RESOLVED WONTFIX
Product: evolution-data-server
Classification: Platform
Component: Contacts
2.32.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2011-05-30 12:20 UTC by Christophe Dumez
Modified: 2011-10-10 09:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (1003 bytes, patch)
2011-05-30 12:20 UTC, Christophe Dumez
needs-work Details | Review
Patch for gnome-3-0 (1.02 KB, patch)
2011-06-06 09:53 UTC, Christophe Dumez
reviewed Details | Review

Description Christophe Dumez 2011-05-30 12:20:59 UTC
Created attachment 188882 [details] [review]
Proposed patch

return_error_and_list currently frees the list elements if free_data is TRUE. However, it does not free the GList itself. This causes a memory leak because the caller (_e_book_backend_get_contact_list) does not free the list either.

See attached patch.

Alternatively, the list could be freed at the end of _e_book_backend_get_contact_list() but I felt it was cleaner to free it in return_error_and_list() since it is called from other places.
Comment 1 Matthew Barnes 2011-05-31 14:48:29 UTC
The return_error_and_list() function no longer exists in the master branch, and the patch does not apply to the gnome-3-0 branch.  If you can provide a revised patch for gnome-3-0 I'll take another look.
Comment 2 Christophe Dumez 2011-06-01 07:27:31 UTC
I have just double-checked the gnome-3-0 branch and it seems this memory leak was already fixed there (the exact same way as in my patch). Someone apparently forgot to backport it to gnome-2-32 branch though. Could someone please apply the patch to gnome-2-32 branch only then?
Comment 3 Christophe Dumez 2011-06-01 07:36:00 UTC
Ignore my last comment, it was not fixed in gnome-3-0 branch (I had my patch applied...). I, however, did not have any problem applying my patch to gnome-3-0.
Comment 4 Christophe Dumez 2011-06-06 09:53:58 UTC
Created attachment 189310 [details] [review]
Patch for gnome-3-0
Comment 5 Milan Crha 2011-08-17 14:26:25 UTC
You've right it's leaking, but the change is not complete. I see that this code is in use only for e_data_book_respond_get_contact_list(), and I cannot speak for any 3rd-party book backends, though from those inside eds are all fine but the google's not, as that is freeing the list itself. evolution-exchange would work fine with your change, but evolution-mapi may crash on double free, as it also frees the list itself.

I know it's bad it's leaking, but I would rather not fix this in stable, because of this mess in handling.
Comment 6 Christophe Dumez 2011-10-08 06:59:02 UTC
Can this fix be considered for master then?
Comment 7 Milan Crha 2011-10-10 09:05:28 UTC
It's obsolete for master and 3.2.0, after EClient changes, where the memory management was cleared during those changes. See comment #1 :) I'm closing this bug.