GNOME Bugzilla – Bug 308794
[auparse] minor memory leak
Last modified: 2005-06-23 16:45:38 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; }
Created attachment 48219 [details] [review] Path for the mem leak
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