mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
validate: flow: Plug some leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/219>
This commit is contained in:
parent
4177f0995e
commit
c45e2612a9
3 changed files with 6 additions and 5 deletions
|
@ -243,7 +243,6 @@ validate_flow_format_buffer (GstBuffer * buffer, gint checksum_type,
|
||||||
gchar *flags_str, *meta_str, *buffer_str;
|
gchar *flags_str, *meta_str, *buffer_str;
|
||||||
gchar *buffer_parts[7];
|
gchar *buffer_parts[7];
|
||||||
int buffer_parts_index = 0;
|
int buffer_parts_index = 0;
|
||||||
gchar *sum;
|
|
||||||
GstMapInfo map;
|
GstMapInfo map;
|
||||||
gchar **logged_fields =
|
gchar **logged_fields =
|
||||||
logged_fields_struct ? gst_validate_utils_get_strv (logged_fields_struct,
|
logged_fields_struct ? gst_validate_utils_get_strv (logged_fields_struct,
|
||||||
|
@ -268,7 +267,7 @@ validate_flow_format_buffer (GstBuffer * buffer, gint checksum_type,
|
||||||
|
|
||||||
buffer_parts[buffer_parts_index++] = g_string_free (content, FALSE);
|
buffer_parts[buffer_parts_index++] = g_string_free (content, FALSE);
|
||||||
} else {
|
} else {
|
||||||
sum =
|
gchar *sum =
|
||||||
g_compute_checksum_for_data (checksum_type ==
|
g_compute_checksum_for_data (checksum_type ==
|
||||||
CHECKSUM_TYPE_AS_ID ? G_CHECKSUM_SHA1 : checksum_type, map.data,
|
CHECKSUM_TYPE_AS_ID ? G_CHECKSUM_SHA1 : checksum_type, map.data,
|
||||||
map.size);
|
map.size);
|
||||||
|
|
|
@ -461,7 +461,7 @@ run_diff (const gchar * expected_file, const gchar * actual_file)
|
||||||
&error);
|
&error);
|
||||||
if (!error) {
|
if (!error) {
|
||||||
gboolean colored = gst_validate_has_colored_output ();
|
gboolean colored = gst_validate_has_colored_output ();
|
||||||
GSubprocess *process;
|
GSubprocess *process2;
|
||||||
gchar *fname = NULL;
|
gchar *fname = NULL;
|
||||||
gint f = g_file_open_tmp ("XXXXXX.diff", &fname, NULL);
|
gint f = g_file_open_tmp ("XXXXXX.diff", &fname, NULL);
|
||||||
|
|
||||||
|
@ -470,12 +470,12 @@ run_diff (const gchar * expected_file, const gchar * actual_file)
|
||||||
g_file_set_contents (fname, stdout_text, -1, NULL);
|
g_file_set_contents (fname, stdout_text, -1, NULL);
|
||||||
close (f);
|
close (f);
|
||||||
|
|
||||||
process =
|
process2 =
|
||||||
g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE, &error, "bat", "-l",
|
g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE, &error, "bat", "-l",
|
||||||
"diff", "--paging", "never", "--color", colored ? "always" : "never",
|
"diff", "--paging", "never", "--color", colored ? "always" : "never",
|
||||||
fname, NULL);
|
fname, NULL);
|
||||||
|
|
||||||
g_subprocess_communicate_utf8 (process, NULL, NULL, &tmpstdout, NULL,
|
g_subprocess_communicate_utf8 (process2, NULL, NULL, &tmpstdout, NULL,
|
||||||
&error);
|
&error);
|
||||||
if (!error) {
|
if (!error) {
|
||||||
g_free (stdout_text);
|
g_free (stdout_text);
|
||||||
|
@ -485,6 +485,7 @@ run_diff (const gchar * expected_file, const gchar * actual_file)
|
||||||
GST_DEBUG ("Could not use bat: %s", error->message);
|
GST_DEBUG ("Could not use bat: %s", error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
|
g_clear_object (&process2);
|
||||||
g_free (fname);
|
g_free (fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ cdata.set('PACKAGE_VERSION', '"@0@"'.format(gst_version))
|
||||||
if cc.has_header('unistd.h')
|
if cc.has_header('unistd.h')
|
||||||
cdata.set('HAVE_UNISTD_H', 1)
|
cdata.set('HAVE_UNISTD_H', 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
configure_file(output : 'config.h', configuration : cdata)
|
configure_file(output : 'config.h', configuration : cdata)
|
||||||
|
|
||||||
validate_plugins_install_dir = '@0@/gstreamer-1.0/validate'.format(get_option('libdir'))
|
validate_plugins_install_dir = '@0@/gstreamer-1.0/validate'.format(get_option('libdir'))
|
||||||
|
|
Loading…
Reference in a new issue