bitwriter: Fix a memory leak in reset_and_get_buffer.
authorHe Junyan <junyan.he@intel.com>
Sun, 19 Sep 2021 14:39:09 +0000 (22:39 +0800)
committerHe Junyan <junyan.he@intel.com>
Sun, 19 Sep 2021 14:43:06 +0000 (22:43 +0800)
commit25dbae6e735ad68bf30780cbd1d917e7c5f0629d
treea74a4674b5d047f7fe9aa409912f5ac88cdc1df3
parent81cf9754e3c29148fd7a867241a87e2ac72e398b
bitwriter: Fix a memory leak in reset_and_get_buffer.

We should record the ownership of the data before we reset the bitwriter.
Or we will always dup the buffer data and leak the memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/886>
libs/gst/base/gstbitwriter.c