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:
Stefan Kost 2009-02-26 17:38:47 +02:00
parent c074e84360
commit 4e4f922d7a

View file

@ -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);
}