validate-utils: Add NULL check

Unlikely to be triggered. And fix typo at the same time

CID #1415464
This commit is contained in:
Edward Hervey 2017-07-18 15:38:04 +02:00 committed by Edward Hervey
parent c8cd695bb9
commit 5b54127c5a

View file

@ -583,11 +583,14 @@ _get_lines (const gchar * scenario_file)
/* Returns: (transfer full): a #GList of #GstStructure */ /* Returns: (transfer full): a #GList of #GstStructure */
static GList * static GList *
_lines_get_strutures (gchar ** lines) _lines_get_structures (gchar ** lines)
{ {
gint i; gint i;
GList *structures = NULL; GList *structures = NULL;
if (lines == NULL)
return NULL;
for (i = 0; lines[i]; i++) { for (i = 0; lines[i]; i++) {
GstStructure *structure; GstStructure *structure;
@ -604,8 +607,7 @@ _lines_get_strutures (gchar ** lines)
} }
done: done:
if (lines) g_strfreev (lines);
g_strfreev (lines);
return structures; return structures;
@ -632,7 +634,7 @@ gst_validate_utils_structs_parse_from_filename (const gchar * scenario_file)
return NULL; return NULL;
} }
return _lines_get_strutures (lines); return _lines_get_structures (lines);
} }
/** /**
@ -648,7 +650,7 @@ gst_validate_structs_parse_from_gfile (GFile * scenario_file)
if (lines == NULL) if (lines == NULL)
return NULL; return NULL;
return _lines_get_strutures (lines); return _lines_get_structures (lines);
} }
static gboolean static gboolean