str =
g_strdup_printf ("foo/bar, range=[ 1, %" G_GINT64_FORMAT " ];",
(gint64) G_MAXINT + 1);
+ s = NULL;
ASSERT_CRITICAL (s = gst_structure_from_string (str, &end));
g_free (str);
- gst_structure_free (s);
+ if (s)
+ gst_structure_free (s);
str =
g_strdup_printf ("foo/bar, range=[ %" G_GINT64_FORMAT ", %"
G_GINT64_FORMAT " ];", (gint64) G_MAXINT, (gint64) G_MAXINT + 1);
ASSERT_CRITICAL (s = gst_structure_from_string (str, NULL));
end = NULL;
g_free (str);
- gst_structure_free (s);
+ if (s)
+ gst_structure_free (s);
/* check a valid int64_range deserialization. Those ranges need to
* be explicit about their storage type. */
str =
g_strdup_printf ("foo/bar, range=(gint64)[ 1, %" G_GUINT64_FORMAT " ];",
(guint64) G_MAXINT64 + 1);
+ s = NULL;
ASSERT_CRITICAL (s = gst_structure_from_string (str, &end));
- fail_unless (*end == '\0');
- gst_structure_free (s);
- end = NULL;
+ if (s) {
+ fail_unless (*end == '\0');
+ gst_structure_free (s);
+ end = NULL;
+ }
g_free (str);
/* check invalid int64_range deserialization into a int64_range */
G_GUINT64_FORMAT " ];", (gint64) G_MAXINT, (guint64) G_MAXINT64 + 1);
ASSERT_CRITICAL (s = gst_structure_from_string (str, NULL));
g_free (str);
- gst_structure_free (s);
+ if (s)
+ gst_structure_free (s);
/* check invalid int64_range deserialization into a int_range */
str =
fail_unless (s != NULL);
fail_unless (*end == '\0');
gst_structure_free (s);
+ s = NULL;
g_free (str);
}
for (n = 0; n < G_N_ELEMENTS (bad_ranges); ++n) {
str = g_strdup_printf ("foo/bar, range=%s", bad_ranges[n]);
ASSERT_CRITICAL (s = gst_structure_from_string (str, &end));
- gst_structure_free (s);
+ if (s)
+ gst_structure_free (s);
g_free (str);
}
}