mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
rtpg729pay: leak fixes
Coverity 1212159
This commit is contained in:
parent
fe4c5b92b1
commit
8e80478cf7
1 changed files with 13 additions and 2 deletions
|
@ -204,6 +204,17 @@ gst_rtp_g729_pay_push (GstRTPG729Pay * rtpg729pay,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GstFlowReturn
|
||||||
|
gst_rtp_g729_pay_push_and_free (GstRTPG729Pay * rtpg729pay,
|
||||||
|
guint8 * data, guint payload_len)
|
||||||
|
{
|
||||||
|
GstFlowReturn ret;
|
||||||
|
|
||||||
|
ret = gst_rtp_g729_pay_push (rtpg729pay, data, payload_len);
|
||||||
|
g_free (data);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_rtp_g729_pay_recalc_rtp_time (GstRTPG729Pay * rtpg729pay, GstClockTime time)
|
gst_rtp_g729_pay_recalc_rtp_time (GstRTPG729Pay * rtpg729pay, GstClockTime time)
|
||||||
{
|
{
|
||||||
|
@ -309,7 +320,7 @@ gst_rtp_g729_pay_handle_buffer (GstRTPBasePayload * payload, GstBuffer * buf)
|
||||||
if (GST_BUFFER_IS_DISCONT (buf)) {
|
if (GST_BUFFER_IS_DISCONT (buf)) {
|
||||||
/* flush remainder */
|
/* flush remainder */
|
||||||
if (available > 0) {
|
if (available > 0) {
|
||||||
gst_rtp_g729_pay_push (rtpg729pay,
|
gst_rtp_g729_pay_push_and_free (rtpg729pay,
|
||||||
gst_adapter_take (adapter, available), available);
|
gst_adapter_take (adapter, available), available);
|
||||||
available = 0;
|
available = 0;
|
||||||
}
|
}
|
||||||
|
@ -354,7 +365,7 @@ gst_rtp_g729_pay_handle_buffer (GstRTPBasePayload * payload, GstBuffer * buf)
|
||||||
(available / G729_FRAME_SIZE) * G729_FRAME_SIZE);
|
(available / G729_FRAME_SIZE) * G729_FRAME_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = gst_rtp_g729_pay_push (rtpg729pay,
|
ret = gst_rtp_g729_pay_push_and_free (rtpg729pay,
|
||||||
gst_adapter_take (adapter, payload_len), payload_len);
|
gst_adapter_take (adapter, payload_len), payload_len);
|
||||||
available -= payload_len;
|
available -= payload_len;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue