mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
rtpsession: don't leak the address
This commit is contained in:
parent
745210e792
commit
af59f573b5
1 changed files with 17 additions and 6 deletions
|
@ -1674,6 +1674,13 @@ update_arrival_stats (RTPSession * sess, RTPArrivalStats * arrival,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clean_arrival_stats (RTPArrivalStats * arrival)
|
||||||
|
{
|
||||||
|
if (arrival->address)
|
||||||
|
g_object_unref (arrival->address);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rtp_session_process_rtp:
|
* rtp_session_process_rtp:
|
||||||
* @sess: and #RTPSession
|
* @sess: and #RTPSession
|
||||||
|
@ -1790,6 +1797,8 @@ rtp_session_process_rtp (RTPSession * sess, GstBuffer * buffer,
|
||||||
|
|
||||||
RTP_SESSION_UNLOCK (sess);
|
RTP_SESSION_UNLOCK (sess);
|
||||||
|
|
||||||
|
clean_arrival_stats (&arrival);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
@ -1801,15 +1810,17 @@ invalid_packet:
|
||||||
}
|
}
|
||||||
ignore:
|
ignore:
|
||||||
{
|
{
|
||||||
gst_buffer_unref (buffer);
|
|
||||||
RTP_SESSION_UNLOCK (sess);
|
RTP_SESSION_UNLOCK (sess);
|
||||||
|
gst_buffer_unref (buffer);
|
||||||
|
clean_arrival_stats (&arrival);
|
||||||
GST_DEBUG ("ignoring RTP packet because we are leaving");
|
GST_DEBUG ("ignoring RTP packet because we are leaving");
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
collision:
|
collision:
|
||||||
{
|
{
|
||||||
gst_buffer_unref (buffer);
|
|
||||||
RTP_SESSION_UNLOCK (sess);
|
RTP_SESSION_UNLOCK (sess);
|
||||||
|
gst_buffer_unref (buffer);
|
||||||
|
clean_arrival_stats (&arrival);
|
||||||
GST_DEBUG ("ignoring packet because its collisioning");
|
GST_DEBUG ("ignoring packet because its collisioning");
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
@ -2391,8 +2402,7 @@ rtp_session_process_rtcp (RTPSession * sess, GstBuffer * buffer,
|
||||||
sess->stats.avg_rtcp_packet_size, arrival.bytes);
|
sess->stats.avg_rtcp_packet_size, arrival.bytes);
|
||||||
RTP_SESSION_UNLOCK (sess);
|
RTP_SESSION_UNLOCK (sess);
|
||||||
|
|
||||||
if (arrival.address)
|
clean_arrival_stats (&arrival);
|
||||||
g_object_unref (arrival.address);
|
|
||||||
|
|
||||||
/* notify caller of sr packets in the callback */
|
/* notify caller of sr packets in the callback */
|
||||||
if (do_sync && sess->callbacks.sync_rtcp) {
|
if (do_sync && sess->callbacks.sync_rtcp) {
|
||||||
|
@ -2415,9 +2425,10 @@ invalid_packet:
|
||||||
}
|
}
|
||||||
ignore:
|
ignore:
|
||||||
{
|
{
|
||||||
gst_buffer_unref (buffer);
|
|
||||||
RTP_SESSION_UNLOCK (sess);
|
RTP_SESSION_UNLOCK (sess);
|
||||||
GST_DEBUG ("ignoring RTP packet because we left");
|
gst_buffer_unref (buffer);
|
||||||
|
clean_arrival_stats (&arrival);
|
||||||
|
GST_DEBUG ("ignoring RTCP packet because we left");
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue