stream: don't leak stats structure

Don't leak the stats structure and deal with NULL stats.
This commit is contained in:
Wim Taymans 2014-01-28 14:51:26 +01:00
parent 7edaa6ca20
commit 036f2760bf

View file

@ -1889,6 +1889,9 @@ gst_rtsp_stream_get_rtpinfo (GstRTSPStream * stream,
g_object_get (priv->payloader, "stats", &stats, NULL);
if (stats == NULL)
goto no_stats;
if (seq)
gst_structure_get_uint (stats, "seqnum", seq);
@ -1904,9 +1907,19 @@ gst_rtsp_stream_get_rtpinfo (GstRTSPStream * stream,
*running_time = GST_CLOCK_TIME_NONE;
}
gst_structure_free (stats);
g_mutex_unlock (&priv->lock);
return TRUE;
/* ERRORS */
no_stats:
{
GST_WARNING ("Could not get payloader stats");
g_mutex_unlock (&priv->lock);
return FALSE;
}
}
/**