mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
rtsprange: don't leak the range in case of parsing error.
Free the gstRTSPTimeRange if we don't return it. Also simplify gst_rtsp_range_free() as it is valid to pass NULL to g_free().
This commit is contained in:
parent
c074e84360
commit
4e4f922d7a
1 changed files with 3 additions and 5 deletions
|
@ -167,9 +167,10 @@ gst_rtsp_range_parse (const gchar * rangestr, GstRTSPTimeRange ** range)
|
|||
} else
|
||||
goto invalid;
|
||||
|
||||
if (ret == GST_RTSP_OK)
|
||||
*range = res;
|
||||
if (ret != GST_RTSP_OK)
|
||||
goto invalid;
|
||||
|
||||
*range = res;
|
||||
return ret;
|
||||
|
||||
/* ERRORS */
|
||||
|
@ -271,8 +272,5 @@ gst_rtsp_range_to_string (const GstRTSPTimeRange * range)
|
|||
void
|
||||
gst_rtsp_range_free (GstRTSPTimeRange * range)
|
||||
{
|
||||
if (range == NULL)
|
||||
return;
|
||||
|
||||
g_free (range);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue