gstvalue: fix leak in gst_value_deserialize_g_date_time()
gst_date_time_to_g_date_time() does not take ownership. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8515>
This commit is contained in:
parent
8162b4ec86
commit
1b04ec5cb2
@ -7521,6 +7521,7 @@ gst_value_serialize_g_date_time (const GValue * val)
|
|||||||
static gboolean
|
static gboolean
|
||||||
gst_value_deserialize_g_date_time (GValue * dest, const gchar * s)
|
gst_value_deserialize_g_date_time (GValue * dest, const gchar * s)
|
||||||
{
|
{
|
||||||
|
GstDateTime *gst_datetime;
|
||||||
GDateTime *datetime;
|
GDateTime *datetime;
|
||||||
|
|
||||||
if (!s || strcmp (s, "null") == 0) {
|
if (!s || strcmp (s, "null") == 0) {
|
||||||
@ -7528,8 +7529,13 @@ gst_value_deserialize_g_date_time (GValue * dest, const gchar * s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The Gstreamer iso8601 parser is a bit more forgiving */
|
/* The Gstreamer iso8601 parser is a bit more forgiving */
|
||||||
datetime =
|
gst_datetime = gst_date_time_new_from_iso8601_string (s);
|
||||||
gst_date_time_to_g_date_time (gst_date_time_new_from_iso8601_string (s));
|
if (gst_datetime == NULL) {
|
||||||
|
GST_WARNING ("Failed to deserialize date time string '%s'", s);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
datetime = gst_date_time_to_g_date_time (gst_datetime);
|
||||||
|
gst_date_time_unref (gst_datetime);
|
||||||
if (datetime != NULL) {
|
if (datetime != NULL) {
|
||||||
g_value_take_boxed (dest, datetime);
|
g_value_take_boxed (dest, datetime);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user