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 689946 - memory leak
memory leak
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: [obsolete] gdu volume monitor
git master
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2012-12-09 23:44 UTC by darkxst
Modified: 2012-12-10 14:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
volumeMonitor: free hash table to avoid leak (995 bytes, patch)
2012-12-09 23:57 UTC, darkxst
none Details | Review

Description darkxst 2012-12-09 23:44:06 UTC
There is a memory leak here

http://git.gnome.org/browse/gvfs/tree/monitor/proxy/gproxyvolumemonitor.c#n1413

Since g_proxy_volume_monitor_setup_session_bus_connection() gets called multiple times.
Comment 1 darkxst 2012-12-09 23:57:39 UTC
Created attachment 231110 [details] [review]
volumeMonitor: free hash table to avoid leak

this function is called multiple times, so the old hash table gets
leaked.

possible fix, although maybe there is some greater logic issue
Comment 2 Tomas Bzatek 2012-12-10 14:42:56 UTC
Ooops, that slipped through my fingers last time I've redone the session bus initialization. Thanks for spotting this, I have committed slightly different patch since the variable is a global table which can already contain data. So let's preserve existing data instead of freeing and emptying it.

Committed to master:

commit 5a6d6ddc66a4bc32aef99f73c9e99a1c3ca91bff
Author: Tomas Bzatek <tbzatek@redhat.com>
Date:   Mon Dec 10 15:37:54 2012 +0100

    proxy volume monitor: Don't leak the_volume_monitors hash table
    
    The the_volume_monitors hash table is a shared global instance, make
    sure to only initialize it once.
    
    Based on a patch by Tim Lunn <tim@feathertop.org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689946