https://bugzilla.gnome.org/show_bug.cgi?id=617980
gnome-perl | Gnome2::GConf | unspecified
Summary: Memory leak in GconfClient::get()
Classification: Bindings
Product: gnome-perl
Version: unspecified
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: Gnome2::GConf
AssignedTo: gtk...@li...
ReportedBy: da...@ko...
QAContact: gtk...@li...
GNOME target: ---
GNOME version: ---
Created an attachment (id=160479)
View: https://bugzilla.gnome.org/attachment.cgi?id=160479
Review: https://bugzilla.gnome.org/review?bug=617980&attachment=160479
patch for GconfClient::get() memory leak
In Gconf::Client provided by rpm perl-Gnome2-GConf.i386-1.044-1.fc8 there
appears to be a memory leak in the get method.
Running this code snippet while monitoring the script in top is enough to see
the issue within a minute:
## <...snip...>
my $client = Gnome2::GConf::Client->get_default;
while (1) {
my $keyhash = $client->get('/my/valid/key');
#print Dumper $keyhash;
}
## end
Where the key is a valid key when checked by uncommenting the print statement.
The issue appears to be that GConf's gconf_client_get() is not being used
correctly in GConfClient.xs.
gconf_client_get_string() in GConf and the other type-specific methods call
gconf_client_get() and then free the GConfValue returned by gconf_client_get()
with gconf_value_free(). So it appears that GConfClient.xs's
gconf_client_get() should do the same.
To fix it I added:
CLEANUP:
gconf_value_free (RETVAL);
to the end of GconfClient.xs's implementation of gconf_client_get(). It
resolved the leak for me.
Patch attached.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
|