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 308794 - [auparse] minor memory leak
[auparse] minor memory leak
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
git master
Other Linux
: Normal normal
: 0.8.10
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-23 15:52 UTC by Antoine Tremblay
Modified: 2005-06-23 16:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Path for the mem leak (388 bytes, patch)
2005-06-23 15:54 UTC, Antoine Tremblay
none Details | Review

Description Antoine Tremblay 2005-06-23 15:52:28 UTC
Run something like :
valgrind --tool=memcheck --leak-check=yes  --leak-resolution=high
--num-callers=30 gst-launch-0.8 filesrc location="Next-Sun, Linear PCM.au" !
auparse ....

You will get :

==10301== 28 bytes in 1 blocks are definitely lost in loss record 1447 of 2171
==10301==    at 0x1B907901: calloc (vg_replace_malloc.c:176)
==10301==    by 0x1BC0AFD3: g_malloc0 (gmem.c:154)
==10301==    by 0x1B9285E2: gst_caps_new_empty (gstcaps.c:81)
==10301==    by 0x1B92864B: gst_caps_new_simple (gstcaps.c:126)
==10301==    by 0x1BA32988: gst_auparse_chain (gstauparse.c:334)

since tempcaps are not freed in the chain function , here's the patch for it :

Use patch -p1 < patch in your plugins dir,...

diff -Naur gst-plugins-cvs-org/gst/auparse/gstauparse.c
gst-plugins-cvs/gst/auparse/gstauparse.c

--- gst-plugins-cvs-org/gst/auparse/gstauparse.c        2005-06-23
11:32:34.116399824 -0400
+++ gst-plugins-cvs/gst/auparse/gstauparse.c    2005-06-23
11:33:45.705516624 -0400
@@ -368,7 +368,8 @@
    GST_BUFFER_SIZE (newbuf) = size - (auparse->offset);

    gst_buffer_unref (buf);
-
+    gst_caps_free(tempcaps);
+
    gst_pad_push (auparse->srcpad, GST_DATA (newbuf));
    return;
  }
Comment 1 Antoine Tremblay 2005-06-23 15:54:46 UTC
Created attachment 48219 [details] [review]
Path for the mem leak
Comment 2 Tim-Philipp Müller 2005-06-23 16:45:38 UTC
Fixed in CVS, thanks! (modified patch slightly, caps needed to be freed in both
code paths)

2005-06-23  Antoine Tremblay  <hexa00 at gmail dot com>

        Reviewed by: Tim-Philipp Muller

        * gst/auparse/gstauparse.c: (gst_auparse_chain):
          Don't leak caps (#308794).

 Cheers
  -Tim