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 556910 - [fam-helper.c:223]: Memory leak: sub
[fam-helper.c:223]: Memory leak: sub
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-10-19 06:34 UTC by Daniel Marjamäki
Modified: 2008-10-24 04:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Marjamäki 2008-10-19 06:34:10 UTC
Please describe the problem:
I have checked out the latest sources through SVN.

In the file glib/gio/fam-helper.c there is this code:

  sub = g_new0 (fam_sub, 1);
  sub->pathname = g_strdup (pathname);
  sub->directory = directory;
  sub->user_data = user_data;
  
  G_LOCK (fam_connection);
  /* We need to queue up incoming messages to avoid blocking on write
   *  if there are many monitors being canceled */
  fam_do_iter_unlocked ();
  
  if (fam_connection == NULL) {
    G_UNLOCK (fam_connection);
    return NULL;
  }

So if fam_connection is NULL, the variable sub will not be deallocated


Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Matthias Clasen 2008-10-24 04:04:48 UTC
2008-10-24  Matthias Clasen  <mclasen@redhat.com>

        Bug 556910 – [fam-helper.c:223]: Memory leak: sub

        * fam/fam-helper.c: Fix a memory leak and formatting issues.
        Reported by Daniel Marjamäki