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 784887 - gsm: Possible Memory leak in gst_buffer_unmap
gsm: Possible Memory leak in gst_buffer_unmap
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.12.1
Other Windows
: Normal normal
: 1.12.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-13 05:39 UTC by Satya Prakash Gupta
Modified: 2017-07-17 08:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gsm: Possible Memory leak in gst_buffer_unmap (785 bytes, patch)
2017-07-17 07:47 UTC, Satya Prakash Gupta
none Details | Review
gsm: Possible Memory leak in gst_buffer_unmap (785 bytes, patch)
2017-07-17 07:50 UTC, Satya Prakash Gupta
committed Details | Review

Description Satya Prakash Gupta 2017-07-13 05:39:51 UTC
Hello All,

There is possible memory leak in gst_buffer_unmap.

File  : gst-plugins-bad/ext/gsm/gstgsmenc.c

In function "gst_gsmenc_handle_frame" at line: 182

gstbuffer is allocated and mapped like :
  
  outbuf = gst_buffer_new_and_alloc (33 * sizeof (gsm_byte));
  gst_buffer_map (outbuf, &omap, GST_MAP_WRITE);

But there is no unmap of this outbuf.


Solution: There should be gst_buffer_unmap (outbuf , &omap) 
instead of   gst_buffer_unmap (buffer, &omap);

Please check and provide your feedback.
Comment 1 Sebastian Dröge (slomo) 2017-07-13 06:44:48 UTC
Can you provide a patch for this?
Comment 2 Satya Prakash Gupta 2017-07-13 07:49:42 UTC
Yes.. I am preparing a patch for this ..soon I will upload it.
Comment 3 Satya Prakash Gupta 2017-07-17 07:47:52 UTC
Created attachment 355732 [details] [review]
gsm: Possible Memory leak in gst_buffer_unmap

Hi,

Please review attached patch and provide your feedback.
Comment 4 Satya Prakash Gupta 2017-07-17 07:50:05 UTC
Created attachment 355733 [details] [review]
gsm: Possible Memory leak in gst_buffer_unmap

Hi All,

Please review the patch and provide your feedback.
Comment 5 Tim-Philipp Müller 2017-07-17 08:28:10 UTC
Thanks!

commit c431fcda78799b2fe477cfb300ff9d86ceeb4b25 (HEAD -> master)
Author: Satya Prakash Gupta <sp.gupta@samsung.com>
Date:   Thu Jul 13 13:17:57 2017 +0530

    gsm: unmap output buffer when done
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784887